Skip to content

Commit

Permalink
feat: Fix ticket reply for closed tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Mar 3, 2024
1 parent 724ed06 commit 1665033
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/sspanel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ def get(self, request, pk):

def post(self, request, pk):
"""添加回复"""
ticket = Ticket.objects.get(pk=pk)
ticket: Ticket = Ticket.objects.get(pk=pk)
if ticket.status == -1:
messages.error(request, "工单已经关闭,请开启新的工单", extra_tags="回复失败")
return HttpResponseRedirect(reverse("sspanel:ticket_detail", args=(pk,)))
ticket.updated_at = get_current_datetime()
ticket.save()
message = request.POST.get("message", "")
Expand Down

0 comments on commit 1665033

Please sign in to comment.