8000 fix: add redirect notification page when in edit mode · django-cms/django-cms@565d4cc · GitHub
[go: up one dir, main page]

Skip to content

Commit 565d4cc

Browse files
committed
fix: add redirect notification page when in edit mode
1 parent e8d1abf commit 565d4cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cms/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ def render_object_endpoint(request, content_type_id, object_id, require_editable
326326
toolbar = get_toolbar_from_request(request)
327327
toolbar.set_object(content_type_obj)
328328

329+
if request.user.is_staff and toolbar.edit_mode_active:
330+
redirect = getattr(content_type_obj, "redirect", None)
331+
if isinstance(redirect, str):
332+
toolbar.redirect_url = redirect
333+
329334
if require_editable and not toolbar.object_is_editable():
330335
# If not editable, switch from edit to preview endpoint
331336
return HttpResponseRedirect(get_object_preview_url(content_type_obj))

0 commit comments

Comments
 (0)
0