1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 07:52:23 +00:00

[WEI] Fix error when validating sometimes a membership

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-09-09 09:27:15 +02:00
parent 2c02c747f4
commit 5793b83de7
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -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()