#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070196fd457659-480a5f96-a389-49a5-8272-2135e5a0118e-000000%40eu-central-1.amazonses.com.