on est moins laxiste

This commit is contained in:
Maurice Debray 2022-03-15 11:10:55 +01:00
parent 7122c1c0c4
commit 764ffea61f
2 changed files with 6 additions and 0 deletions

View file

@ -17,6 +17,10 @@ class ParticipantsAdmin(admin.ModelAdmin):
]
readonly_fields = ["creationDate", "updateDate"]
list_display = ["participant", "event", "reponse", "creationDate", "updateDate"]
def has_add_permission(self, req):
return False
def has_change_permission(self, change):
return False
# Add event by admin page return a 502 error

View file

@ -78,3 +78,5 @@ class Participants(models.Model):
updateDate = models.DateTimeField(
auto_now=True, verbose_name=_("Dernière mise à jour")
)
class Meta:
constraints = [ UniqueConstraint(fields=['event', 'participant'], name='reponse unique aux event') ]