From 5793b83de772717e173cc677db13d207efc694f1 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Thu, 9 Sep 2021 09:27:15 +0200 Subject: [PATCH] [WEI] Fix error when validating sometimes a membership Signed-off-by: Yohann D'ANELLO --- apps/wei/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/wei/views.py b/apps/wei/views.py index 83f40f3b..c24b6c45 100644 --- a/apps/wei/views.py +++ b/apps/wei/views.py @@ -973,12 +973,11 @@ class WEIValidateRegistrationView(ProtectQuerysetMixin, ProtectedCreateView): membership.roles.set(WEIRole.objects.filter(name="1A").all()) membership.save() - ret = super().form_valid(form) - + membership.save() membership.refresh_from_db() membership.roles.add(WEIRole.objects.get(name="Adhérent WEI")) - return ret + return super().form_valid(form) def get_success_url(self): self.object.refresh_from_db()