#36412: Add redirect_with_message() shortcut for simplified redirects with Django
messages
-------------------------------------+-------------------------------------
Reporter: Mobin-Ghaemi | Type: New
| feature
Status: new | Component: Core
| (Other)
Version: 5.1 | Severity: Normal
Keywords: shortcuts redirect | Triage Stage:
message | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
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
--
Ticket URL: <
https://code.djangoproject.com/ticket/36412>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.