feat(users): redirect to category after media delete
Introduce a custom `get_success_url` method in the `MediaDeleteView` to redirect users back to the specific category page they were on, upon successfully deleting media. This enhancement improves user experience by maintaining the context of their browsing session, avoiding disorientation that could result from being redirected to a generic page.
This commit is contained in:
parent
ac2c4e788f
commit
7a79b5cdc9
|
@ -170,6 +170,8 @@ class MediaDeleteView(LoginRequiredMixin, TitleMixin, DeleteView):
|
|||
except (OriginalMedia.DoesNotExist, AssertionError):
|
||||
raise Http404()
|
||||
|
||||
def get_success_url(self):
|
||||
return reverse_lazy("quackscape.users:category", kwargs={"category": self.kwargs["category"]})
|
||||
|
||||
class Login(TitleMixin, LoginView):
|
||||
title = "Login"
|
||||
|
|
Loading…
Reference in a new issue