8000 LanguageError is thrown when user.is_staff and toolbar.edit_mode are True · Issue #5841 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content
LanguageError is thrown when user.is_staff and toolbar.edit_mode are True #5841
Closed
@nolsto

Description

@nolsto

Summary

A condition in my multisite app causes me to have arrived at a cms view with current_language = 'en-us' and user_languages = ['en-gb', 'fr'] at cms/views.py#L83.

When the user is unauthenticated, or the user is staff but the toolbar is not in edit mode, the elif condition of cms/views.py#L96-L99 is reached and an HttpResponseRedirect to /en-gb/ is returned. All good.

When the user is staff, and the toolbar is in edit mode, request.toolbar.redirect_url is set, but a LanguageError is thrown at cms/views.py#L110 in get_redirect_on_fallback before a response can be returned.

Expected behaviour

I expect to be redirected to /en-gb/ regardless of the properties of the user or the toolbar state.

Environment

  • Python version: 3.5.2
  • Django version: 1.9.10
  • django CMS version: 3.3.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      2903
      0