8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 11:53:12 +00:00

fix de l'emménagement forcé

This commit is contained in:
Hugo LEVY-FALK 2018-05-14 23:16:36 +02:00
parent eebb02c989
commit c1ceb5e2b3

View file

@ -340,7 +340,10 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
"""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 room is None:
raise forms.ValidationError("Invalid Room")
remove_user_room(room)
return