diff --git a/apps/tickets/views/approve.py b/apps/tickets/views/approve.py index 21e5b4af6..8dcda595f 100644 --- a/apps/tickets/views/approve.py +++ b/apps/tickets/views/approve.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals from django.core.cache import cache +from django.http import HttpResponse from django.shortcuts import redirect, reverse from django.utils.translation import gettext as _ from django.views.generic.base import TemplateView @@ -79,6 +80,9 @@ class TicketDirectApproveView(TemplateView): return super().get_context_data(**kwargs) def get(self, request, *args, **kwargs): + if not request.user.is_authenticated: + return HttpResponse(status=401) + token = kwargs.get('token') ticket_info = cache.get(token) if not ticket_info: