Commit 215124c3 authored by Daniel W Bond's avatar Daniel W Bond

'None' is not considered as 'a Room' when calculating student occupancy caps

parent 57fa46cd
......@@ -78,6 +78,7 @@ class StudentUpdateForm(forms.Form):
def clean(self):
cleaned_data = super(StudentUpdateForm, self).clean()
form_room = cleaned_data.get('room')
if not(form_room is None):
students_in_room = Student.objects.filter(room=form_room).count()
#print(students_in_room)
# like in bookshare, I have no idea why the form errors don't display.
......@@ -117,6 +118,7 @@ class WelcomePrivacyForm(forms.ModelForm):
def clean(self):
cleaned_data = super(WelcomePrivacyForm, self).clean()
form_room = cleaned_data.get('room')
if not(form_room is None):
students_in_room = Student.objects.filter(room=form_room).count()
#print(students_in_room)
# like in bookshare, I have no idea why the form errors don't display.
......
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