Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
215124c3
Commit
215124c3
authored
Dec 10, 2015
by
Daniel W Bond
Browse files
'None' is not considered as 'a Room' when calculating student occupancy caps
parent
57fa46cd
Changes
1
Show whitespace changes
Inline
Side-by-side
roomlist/accounts/forms.py
View file @
215124c3
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment