Merge pull request #392 from DarrenRiedlinger/login_view_ticketlist_AttributeError

Fixes #391 getattr on usersettings.setting dict always returns False.
This commit is contained in:
Ross Poulton 2016-03-07 09:26:28 +11:00
commit 303872d7c2

View File

@ -25,7 +25,7 @@ def homepage(request):
if (request.user.is_staff or (request.user.is_authenticated() and helpdesk_settings.HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE)): if (request.user.is_staff or (request.user.is_authenticated() and helpdesk_settings.HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE)):
try: try:
if getattr(request.user.usersettings.settings, 'login_view_ticketlist', False): if request.user.usersettings.settings.get('login_view_ticketlist', False):
return HttpResponseRedirect(reverse('helpdesk_list')) return HttpResponseRedirect(reverse('helpdesk_list'))
else: else:
return HttpResponseRedirect(reverse('helpdesk_dashboard')) return HttpResponseRedirect(reverse('helpdesk_dashboard'))