8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-27 07:02:26 +00:00

Fixes Issue 221

This commit is contained in:
Maxime Bombar 2019-09-10 17:09:26 +02:00
parent 9f800a6c02
commit 07071c7cf9

View file

@ -371,8 +371,9 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
def clean_force(self):
"""On supprime l'ancien user de la chambre si et seulement si la
case est cochée"""
if self.cleaned_data.get('force', False):
remove_user_room(self.cleaned_data.get('room'))
room = self.cleaned_data.get('room')
if self.cleaned_data.get('force', False) and room:
remove_user_room(room)
return