mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-04 00:42:50 +02:00
Coaches can update their photo authorization
This commit is contained in:
@ -307,14 +307,14 @@ class UserUploadPhotoAuthorizationView(UserRegistrationMixin, UpdateView):
|
||||
"""
|
||||
A participant can send its photo authorization.
|
||||
"""
|
||||
model = StudentRegistration
|
||||
model = ParticipantRegistration
|
||||
form_class = PhotoAuthorizationForm
|
||||
template_name = "registration/upload_photo_authorization.html"
|
||||
extra_context = dict(title=_("Upload photo authorization"))
|
||||
|
||||
@transaction.atomic
|
||||
def form_valid(self, form):
|
||||
old_instance = StudentRegistration.objects.get(pk=self.object.pk)
|
||||
old_instance = ParticipantRegistration.objects.get(pk=self.object.pk)
|
||||
if old_instance.photo_authorization:
|
||||
old_instance.photo_authorization.delete()
|
||||
old_instance.save()
|
||||
|
Reference in New Issue
Block a user