Commit c1ceb5e2 authored by Hugo LEVY-FALK's avatar Hugo LEVY-FALK

fix de l'emménagement forcé

parent eebb02c9
...@@ -340,7 +340,10 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm): ...@@ -340,7 +340,10 @@ class AdherentForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
"""On supprime l'ancien user de la chambre si et seulement si la """On supprime l'ancien user de la chambre si et seulement si la
case est cochée""" case est cochée"""
if self.cleaned_data.get('force', False): 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 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