mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +00:00
Fix du forcer le déménagement
This commit is contained in:
parent
b940dfbff3
commit
6c61ce7840
1 changed files with 5 additions and 1 deletions
|
@ -340,7 +340,11 @@ 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