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

added conditional to addition of welcome messages on log in: do not welcome blocked students

parent 92cf7743
Pipeline #1397 passed with stage
in 3 minutes and 23 seconds
...@@ -34,8 +34,10 @@ def custom_cas_login(request, *args, **kwargs): ...@@ -34,8 +34,10 @@ def custom_cas_login(request, *args, **kwargs):
elif not request.user.completedSocial: elif not request.user.completedSocial:
return HttpResponseRedirect(reverse('welcomeSocial')) return HttpResponseRedirect(reverse('welcomeSocial'))
else: else:
welcome_back = random.choice(return_messages) # do not 'welcome back' blocked users
messages.add_message(request, messages.INFO, mark_safe(welcome_back)) if not request.user.student.blocked:
welcome_back = random.choice(return_messages)
messages.add_message(request, messages.INFO, mark_safe(welcome_back))
return response return response
......
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