Simplify flag system

This commit is contained in:
Ludovic Stephan 2017-07-21 21:06:45 +02:00
parent e2d5e726cd
commit 910d8fe9c0
2 changed files with 2 additions and 6 deletions

View file

@ -16,7 +16,6 @@ class Equipment(EventSpecificMixin, models.Model):
related_name="equipment", related_name="equipment",
through="EquipmentAttribution", through="EquipmentAttribution",
) )
needs_event_permissions = True
class Meta: class Meta:
verbose_name = _("matériel") verbose_name = _("matériel")
@ -31,7 +30,6 @@ class EquipmentAttribution(models.Model):
activity = models.ForeignKey(Activity) activity = models.ForeignKey(Activity)
amount = models.PositiveSmallIntegerField(_("quantité attribuée")) amount = models.PositiveSmallIntegerField(_("quantité attribuée"))
remarks = models.TextField(_("remarques concernant l'attribution")) remarks = models.TextField(_("remarques concernant l'attribution"))
needs_event_permissions = True
class Meta: class Meta:
verbose_name = _("attribution de matériel") verbose_name = _("attribution de matériel")

View file

@ -50,6 +50,7 @@ class EventSpecificMixin(models.Model):
blank=True, blank=True,
null=True null=True
) )
needs_event_permissions = True
class Meta: class Meta:
abstract = True abstract = True
@ -61,7 +62,6 @@ class Place(EventSpecificMixin, models.Model):
max_length=200, max_length=200,
) )
description = models.TextField(blank=True) description = models.TextField(blank=True)
needs_event_permissions = True
class Meta: class Meta:
verbose_name = _("lieu") verbose_name = _("lieu")
@ -93,7 +93,6 @@ class ActivityTag(EventSpecificMixin, models.Model):
validators=[color_regex], validators=[color_regex],
help_text=_("Rentrer une couleur en hexadécimal"), help_text=_("Rentrer une couleur en hexadécimal"),
) )
needs_event_permissions = True
class Meta: class Meta:
verbose_name = _("tag") verbose_name = _("tag")
@ -148,13 +147,13 @@ class AbstractActivityTemplate(SubscriptionMixin, models.Model):
Place, Place,
blank=True, blank=True,
) )
needs_event_permissions = True
class Meta: class Meta:
abstract = True abstract = True
class ActivityTemplate(AbstractActivityTemplate): class ActivityTemplate(AbstractActivityTemplate):
needs_event_permissions = True
class Meta: class Meta:
verbose_name = _("template activité") verbose_name = _("template activité")
@ -177,7 +176,6 @@ class Activity(AbstractActivityTemplate):
beginning = models.DateTimeField(_("heure de début")) beginning = models.DateTimeField(_("heure de début"))
end = models.DateTimeField(_("heure de fin")) end = models.DateTimeField(_("heure de fin"))
needs_event_permissions = True
def get_herited(self, attrname): def get_herited(self, attrname):
inherited_fields = [f.name for f in ActivityTemplate._meta.get_fields()] inherited_fields = [f.name for f in ActivityTemplate._meta.get_fields()]