Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#36412 closed New feature (wontfix)

Add redirect_with_message() shortcut for simplified redirects with Django messages

Reported by: Mobin Ghaemi Owned by:
Component: Core (Other) Version: 5.1
Severity: Normal Keywords: shortcuts redirect message
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This ticket introduces a new redirect_with_message() shortcut in django.shortcuts.

The goal is to simplify common patterns where a user is redirected to a URL and a message is attached via Django’s messaging framework.

This new utility:

Accepts request, target url, message text, and optional msg_type (info, success, error, etc.)

Internally calls messages.add_message() and returns HttpResponseRedirect

Enhances code readability and consistency in views

See: https://github.com/django/django/pull/19499

Change History (2)

comment:1 by Sarah Boyce, 3 months ago

Resolution: wontfix
Status: newclosed

Thank you for your suggestion! When suggesting a new feature for Django, the feature idea should first be proposed and discussed with the community. To do that, please raise this on the new feature tracker.

I'll close the ticket for now, but if the community agrees with the proposal, please return to this ticket and reference the discussion so we can re-open it. For more information, please refer to the documented guidelines for requesting features.

comment:2 by Mobin Ghaemi, 3 months ago

Last edited 3 months ago by Tim Graham (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top