From bcda879f3b76f8ab0ae67f2c9a20508b29cc3f74 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 13 Sep 2023 17:19:13 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20ticket=20=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tickets/views/approve.py | 4 ++++ 1 file changed, 4 insertions(+) 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: