|
@@ -50,13 +50,14 @@ class TicketDetailView(LoginRequiredMixin, UserCanReadTicketMixin, DetailView):
|
|
|
status = request.POST.get("ticket-status")
|
|
|
|
|
|
if int(status) in ticket.get_available_statuses():
|
|
|
+ old_status = ticket.status
|
|
|
ticket.status = int(status)
|
|
|
ticket.save()
|
|
|
messages.success(request, f"Status successfully changed.")
|
|
|
Event.objects.create(
|
|
|
author=request.user,
|
|
|
ticket=ticket,
|
|
|
- body="Ticket status was changed"
|
|
|
+ body="Ticket status was changed from "+old_status+" to "+status
|
|
|
)
|
|
|
else:
|
|
|
messages.error(request, f"Status change error.")
|