From 3cfc8688cb2148fff5acb101ec67d4900bfcb18c Mon Sep 17 00:00:00 2001 From: Ashfaq Ahmed <46718979+ashfaq1934@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:16:44 +0100 Subject: [PATCH] replaced hardcoded url route with django reverse method --- silk/views/request_detail.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/silk/views/request_detail.py b/silk/views/request_detail.py index 38bf009d..bd890d1b 100644 --- a/silk/views/request_detail.py +++ b/silk/views/request_detail.py @@ -3,6 +3,7 @@ from django.shortcuts import HttpResponseRedirect, redirect, render from django.utils.decorators import method_decorator from django.views.generic import View +from django.urls import reverse_lazy, reverse from silk.auth import login_possibly_required, permissions_possibly_required from silk.code_generation.curl import curl_cmd @@ -48,5 +49,5 @@ def post(self, request, request_id): try: silk_request.delete() except Request.DoesNotExist: - return HttpResponseRedirect(request.headers.get('Referer', '/silk')) - return redirect('/silk') + return HttpResponseRedirect(request.headers.get('Referer', reverse("silk:summary"))) + return redirect(reverse("silk:summary"))