Commit b0610b96 authored by Daniel W Bond's avatar Daniel W Bond

not having an 'or' evaluation prevents students from being able to remove...

not having an 'or' evaluation prevents students from being able to remove their last blocked major... I have no idea how I missed this before. tfw no test-driven development
parent ec5396c2
......@@ -269,7 +269,7 @@ class UpdateStudent(LoginRequiredMixin, FormValidMessageMixin, FormView):
form_blocked_pks = set(form.data.getlist('blocked_kids'))
current_blocked = me.blocked_kids.all()
# most people will not being blocking other students
if form_blocked_pks:
if form_blocked_pks or current_blocked:
form_blocked = [Student.objects.get(pk=pk) for pk in form_blocked_pks]
for current_block in current_blocked:
if current_block not in form_blocked:
......
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