Remove `Clef` Model

This commit is contained in:
Yohann D'ANELLO 2020-02-09 17:55:51 +01:00
parent 0f0e5fcd25
commit 87063e267e
3 changed files with 1 additions and 39 deletions

View File

@ -106,10 +106,6 @@ bureau
users | Can add adhesion
users | Can change adhesion
users | Can delete adhesion
users | Can view clef
users | Can add clef
users | Can change clef
users | Can delete clef
users | Can view user
users | Can add user
users | Can change user
@ -134,7 +130,6 @@ keyholder
media | Can change borrowed item
media | Can delete borrowed item
users | Can view user
users | Can view clef
users (default group for everyone)
media | Can view author

View File

@ -13,14 +13,7 @@ from reversion.admin import VersionAdmin
from med.admin import admin_site
from .forms import UserCreationAdminForm
from .models import Adhesion, Clef, User
class ClefAdmin(VersionAdmin):
list_display = ('name', 'owner', 'comment')
ordering = ('name',)
search_fields = ('name', 'owner__username', 'comment')
autocomplete_fields = ('owner',)
from .models import Adhesion, User
class AdhesionAdmin(VersionAdmin):
@ -116,4 +109,3 @@ class UserAdmin(VersionAdmin, BaseUserAdmin):
admin_site.register(User, UserAdmin)
admin_site.register(Adhesion, AdhesionAdmin)
admin_site.register(Clef, ClefAdmin)

View File

@ -50,31 +50,6 @@ class User(AbstractUser):
return last_year and self in last_year.members.all()
class Clef(models.Model):
name = models.CharField(
verbose_name=_('name'),
max_length=255,
unique=True,
)
owner = models.ForeignKey(
'User',
on_delete=models.PROTECT,
verbose_name=_('owner'),
blank=True,
null=True,
)
comment = models.CharField(
verbose_name=_('comment'),
max_length=255,
null=True,
blank=True,
)
class Meta:
verbose_name = _('key')
verbose_name_plural = _('keys')
class Adhesion(models.Model):
starting_in = models.IntegerField(
verbose_name=_('starting in'),