1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 03:58:26 +02:00

Teams must send their motivation letter

This commit is contained in:
Yohann D'ANELLO
2021-01-22 09:40:28 +01:00
parent 628f69e772
commit ce206998f0
12 changed files with 402 additions and 224 deletions

View File

@ -343,6 +343,7 @@ class TestRegistration(TestCase):
self.student.registration.refresh_from_db()
self.student.registration.photo_authorization.delete()
self.student.registration.save()
def test_user_detail_forbidden(self):
"""

View File

@ -329,6 +329,7 @@ class UserUploadPhotoAuthorizationView(UserMixin, UpdateView):
old_instance = StudentRegistration.objects.get(pk=self.object.pk)
if old_instance.photo_authorization:
old_instance.photo_authorization.delete()
old_instance.save()
return super().form_valid(form)
def get_success_url(self):
@ -355,6 +356,7 @@ class UserUploadHealthSheetView(UserMixin, UpdateView):
old_instance = StudentRegistration.objects.get(pk=self.object.pk)
if old_instance.health_sheet:
old_instance.health_sheet.delete()
old_instance.save()
return super().form_valid(form)
def get_success_url(self):
@ -381,6 +383,7 @@ class UserUploadParentalAuthorizationView(UserMixin, UpdateView):
old_instance = StudentRegistration.objects.get(pk=self.object.pk)
if old_instance.parental_authorization:
old_instance.parental_authorization.delete()
old_instance.save()
return super().form_valid(form)
def get_success_url(self):