mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 07:53:19 +01:00
Fix issue when user does not have yet settings
This commit is contained in:
parent
5b47370ec6
commit
7e84935853
@ -17,14 +17,17 @@ from django.utils.translation import ugettext as _
|
|||||||
|
|
||||||
from helpdesk.forms import PublicTicketForm
|
from helpdesk.forms import PublicTicketForm
|
||||||
from helpdesk.lib import send_templated_mail, text_is_spam
|
from helpdesk.lib import send_templated_mail, text_is_spam
|
||||||
from helpdesk.models import Ticket, Queue
|
from helpdesk.models import Ticket, Queue, UserSettings
|
||||||
|
|
||||||
|
|
||||||
def homepage(request):
|
def homepage(request):
|
||||||
if request.user.is_staff:
|
if request.user.is_staff:
|
||||||
if getattr(request.user.usersettings.settings, 'login_view_ticketlist', False):
|
try:
|
||||||
return HttpResponseRedirect(reverse('helpdesk_list'))
|
if getattr(request.user.usersettings.settings, 'login_view_ticketlist', False):
|
||||||
else:
|
return HttpResponseRedirect(reverse('helpdesk_list'))
|
||||||
|
else:
|
||||||
|
return HttpResponseRedirect(reverse('helpdesk_dashboard'))
|
||||||
|
except UserSettings.DoesNotExist:
|
||||||
return HttpResponseRedirect(reverse('helpdesk_dashboard'))
|
return HttpResponseRedirect(reverse('helpdesk_dashboard'))
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
Loading…
Reference in New Issue
Block a user