Skip to content

Commit

Permalink
Merge a7d5083 into f292f8a
Browse files Browse the repository at this point in the history
  • Loading branch information
SteinRobert committed Jun 23, 2018
2 parents f292f8a + a7d5083 commit 0e9de14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -4,6 +4,7 @@
* Fixed a bug where xframe options were processed by clickjacking middleware
when page was served from cache, rather then get this value from cache
* Fixed a bug where cached page permissions overrides global permissions
* Fixed broken wizard page creation when no language is set within the template context (see #5828).


=== 3.4.6 (2018-03-26) ===
Expand Down
5 changes: 5 additions & 0 deletions cms/utils/decorators.py
Expand Up @@ -23,6 +23,11 @@ def inner(request, *args, **kwargs):
elif hasattr(func, '__class__'):
inner.__name__ = func.__class__.__name__

if hasattr(func, '__qualname__'):
inner.__qualname__ = func.__qualname__
elif hasattr(func, '__class__') and hasattr(func.__class__, '__qualname__'):
inner.__qualname__ = func.__class__.__qualname__

if getattr(func, 'csrf_exempt', False):
# view has set csrf_exempt flag
# so pass it down to the decorator.
Expand Down
6 changes: 3 additions & 3 deletions cms/wizards/views.py
Expand Up @@ -8,7 +8,7 @@
from django.core.files.storage import FileSystemStorage
from django.core.urlresolvers import NoReverseMatch
from django.template.response import SimpleTemplateResponse
from django.utils.translation import get_language_from_request
from cms.utils import get_language_from_request

from formtools.wizard.views import SessionWizardView

Expand Down Expand Up @@ -89,7 +89,7 @@ def get_form_kwargs(self, step=None):
kwargs['wizard_user'] = self.request.user
if self.is_second_step(step):
kwargs['wizard_page'] = self.get_origin_page()
kwargs['wizard_language'] = self.get_origin_language()
kwargs['wizard_language'] = get_language_from_request(self.request)
else:
page_pk = self.page_pk or self.request.GET.get('page', None)
if page_pk and page_pk != 'None':
Expand All @@ -105,7 +105,7 @@ def get_form_initial(self, step):
initial = super(WizardCreateView, self).get_form_initial(step)
if self.is_first_step(step):
initial['page'] = self.request.GET.get('page')
initial['language'] = self.request.GET.get('language')
initial['language'] = get_language_from_request(self.request)
return initial

def get_step_2_form(self, step=None, data=None, files=None):
Expand Down

0 comments on commit 0e9de14

Please sign in to comment.