Commit cbd1ae75 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

the privacy filtering already handles this, but this makes it more correct for...

the privacy filtering already handles this, but this makes it more correct for the user-- if you don't live on campus you can't set to 'floor' or 'room'-- that just doesn't make sense
parent 35ae80f9
...@@ -272,6 +272,13 @@ class UpdateStudent(LoginRequiredMixin, FormValidMessageMixin, FormView): ...@@ -272,6 +272,13 @@ class UpdateStudent(LoginRequiredMixin, FormValidMessageMixin, FormView):
me.on_campus = on_campus me.on_campus = on_campus
me.room = form_room me.room = form_room
# if you don't live on campus you can't limit yourself to a nonexistent
# floor or room
if not(me.on_campus):
me.privacy = 'students'
else:
me.privacy = form.data['privacy']
try: try:
# in case someone disabled the js, limit processing to only the first # in case someone disabled the js, limit processing to only the first
# two majors passed by the user # two majors passed by the user
...@@ -315,7 +322,6 @@ class UpdateStudent(LoginRequiredMixin, FormValidMessageMixin, FormView): ...@@ -315,7 +322,6 @@ class UpdateStudent(LoginRequiredMixin, FormValidMessageMixin, FormView):
me.user.last_name = no_nums(form.data['last_name']) me.user.last_name = no_nums(form.data['last_name'])
me.gender = form.data.getlist('gender') me.gender = form.data.getlist('gender')
me.show_gender = strtobool(form.data.get('show_gender', 'False')) me.show_gender = strtobool(form.data.get('show_gender', 'False'))
me.privacy = form.data['privacy']
me.graduating_year = form.data['graduating_year'] me.graduating_year = form.data['graduating_year']
me.user.save() me.user.save()
me.save() me.save()
......
...@@ -161,6 +161,11 @@ class WelcomePrivacy(LoginRequiredMixin, FormView): ...@@ -161,6 +161,11 @@ class WelcomePrivacy(LoginRequiredMixin, FormView):
me.on_campus = on_campus me.on_campus = on_campus
me.room = form_room me.room = form_room
if not(me.on_campus):
me.privacy = 'students'
else:
me.privacy = form.data['privacy']
me.completedPrivacy = True me.completedPrivacy = True
me.save() me.save()
......
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