mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 07:02:26 +00:00
fix de l'emménagement forcé
This commit is contained in:
parent
eebb02c989
commit
c1ceb5e2b3
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue