When deleting readthrough, progressupdate or status, return to referer instead of main page

This commit is contained in:
Joeri de Ruiter 2023-08-01 17:19:10 +02:00
parent 2f8cf941af
commit d1bad521e9
2 changed files with 4 additions and 4 deletions

View file

@ -203,7 +203,7 @@ def delete_readthrough(request):
readthrough.raise_not_deletable(request.user)
readthrough.delete()
return redirect("/")
return redirect_to_referer(request)
@login_required
@ -214,4 +214,4 @@ def delete_progressupdate(request):
update.raise_not_deletable(request.user)
update.delete()
return redirect("/")
return redirect_to_referer(request)

View file

@ -8,7 +8,7 @@ from django.core.validators import URLValidator
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.http import HttpResponse, HttpResponseBadRequest, Http404
from django.shortcuts import get_object_or_404, redirect
from django.shortcuts import get_object_or_404
from django.template.response import TemplateResponse
from django.utils import timezone
from django.utils.decorators import method_decorator
@ -176,7 +176,7 @@ class DeleteStatus(View):
# perform deletion
status.delete()
return redirect("/")
return redirect_to_referer(request)
@login_required