on est moins laxiste
This commit is contained in:
parent
7122c1c0c4
commit
764ffea61f
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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') ]
|
||||
|
|
Loading…
Reference in a new issue