8000 Backport to prepare for 3.7.1 by FinalAngel · Pull Request #6762 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

Backport to prepare for 3.7.1 #6762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Sites - Pass Site obj instead of pk when creating a StaticPlaceholder (
…#6679)

* Pass site object instead of pk when rendering menu

Add original fix by @saqlainsyed007

* Moved test to it's own class

* Update changelog
  • Loading branch information
michauds authored and FinalAngel committed Nov 12, 2019
commit cb56e872d2b16093eece0d52c10dbc75566e772a
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ Contributors (based on gitlog, 543 unique authors):
* Samuel Lahti
* Samuel Luescher
* Samuel Lüscher
* saqlainsyed007
* Sascha Marcel Schmidt
* sbussetti
* Schoen
Expand Down Expand Up @@ -503,6 +504,7 @@ Contributors (based on gitlog, 543 unique authors):
* Stephan Hepper
* Stephan Herzog
* Stephan Jaekel
* Stephan Michaud
* Stephen Muss
* Stephen Paulger
* Stephen Watkin
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
=== 3.7.1 (unreleased) ===

* Fixed ``ValueError`` when creating a ``Site``-bound ``StaticPlaceholder``
* Updated branch policy
* Improved and simplified permissions documentation
* Improved apphooks documentation
* Improved CMSPluginBase documentation
* Improved documentation related to nested plugins


=== 3.7.0 (2019-09-25) ===

* Introduced Django 2.2 support.
Expand Down
2 changes: 1 addition & 1 deletion cms/templatetags/cms_js_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def render_cms_structure_js(context, renderer, obj):
}

if static_placeholder.site_bound:
kwargs['site'] = renderer.current_site.pk
kwargs['site'] = renderer.current_site
else:
kwargs['site_id__isnull'] = True

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% load cms_tags %}

{% cms_toolbar %}

{% static_placeholder 'test-static' site %}
17 changes: 17 additions & 0 deletions cms/tests/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,20 @@ def test_site_publish(self):
page_url = page.get_absolute_url(language='de')
response = self.client.get(page_url)
self.assertEqual(response.status_code, 200)


class TestSiteBoundStaticPlaceholder(SiteTestCase):
def setUp(self):
super(TestSiteBoundStaticPlaceholder, self).setUp()
with self.settings(
CMS_TEMPLATES=(('placeholder_tests/static_with_site.html', 'tpl'), ),
):
self.test_page = create_page('page', 'placeholder_tests/static_with_site.html', language='de')

def tearDown(self):
self.test_page.delete()
super(TestSiteBoundStaticPlaceholder, self).tearDown()

def test_create_site_specific_placeholder(self):
response = self.client.get(self.test_page.get_absolute_url(language='de') + '?structure')
self.assertEqual(response.status_code, 200)
0