Ticket #2918 added is_preview flag to serve_preview methods

pull/3496/head
Wietze Helmantel 2017-03-23 16:27:44 +01:00 zatwierdzone przez Matt Westcott
rodzic 67ff4c26df
commit 285d9f0b43
5 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -36,6 +36,7 @@ Changelog
* Fix: Search indexing now uses a defined query ordering to prevent objects from being skipped (Christian Peters)
* Fix: Ensure that number localisation is not applied to object IDs within admin templates (Tom Hendrikx)
* Fix: Paginating with a search present was always returning the 1st page in Internet Explorer 10 & 11 (Ralph Jacobs)
* Fix: RoutablePageMixin and wagtailforms previews now set the `request.is_preview` flag (Wietze Helmantel)
1.9 (16.02.2017)

Wyświetl plik

@ -220,6 +220,7 @@ Contributors
* hdnpl
* Tom Hendrikx
* Ralph Jacobs
* Wietze Helmantel
Translators
===========

Wyświetl plik

@ -48,6 +48,7 @@ Bug fixes
* Search indexing now uses a defined query ordering to prevent objects from being skipped (Christian Peters)
* Ensure that number localisation is not applied to object IDs within admin templates (Tom Hendrikx)
* Paginating with a search present was always returning the 1st page in Internet Explorer 10 & 11 (Ralph Jacobs)
* RoutablePageMixin and wagtailforms previews now set the ``request.is_preview`` flag (Wietze Helmantel)
Upgrade considerations

Wyświetl plik

@ -104,6 +104,8 @@ class RoutablePageMixin(object):
def serve_preview(self, request, mode_name):
view, args, kwargs = self.resolve_subpage('/')
request.is_preview = True
return view(request, *args, **kwargs)

Wyświetl plik

@ -266,6 +266,8 @@ class AbstractForm(Page):
def serve_preview(self, request, mode):
if mode == 'landing':
request.is_preview = True
return render(
request,
self.get_landing_page_template(request),