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

Fix du forcer le déménagement

This commit is contained in:
Hugo LEVY-FALK 2018-05-15 00:00:46 +02:00
parent b940dfbff3
commit 6c61ce7840

View file

@ -340,7 +340,11 @@ 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