Commit 6c61ce78 authored by Levy--Falk Hugo's avatar Levy--Falk Hugo

Fix du forcer le déménagement

parent b940dfbf
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment