Revised and simplified the code for the URL on txn_delete() in the accounting application.

This commit is contained in:
依瑪貓 2020-08-05 09:30:10 +08:00
parent 34fb682de1
commit dd8b192913

View File

@ -948,10 +948,7 @@ def txn_delete(request, txn):
txn.delete() txn.delete()
for x in txn_to_sort: for x in txn_to_sort:
x.save() x.save()
if "r" in request.GET: url = request.GET.get("r") or reverse("accounting:home")
url = request.GET.get("r")
else:
url = reverse("accounting:home")
message = gettext_noop("This transaction was deleted successfully.") message = gettext_noop("This transaction was deleted successfully.")
return success_redirect(request, url, message) return success_redirect(request, url, message)