8000 Pass site object instead of pk when rendering menu · django-cms/django-cms@463984d · GitHub
[go: up one dir, main page]

Skip to content

Commit 463984d

Browse files
committed
Pass site object instead of pk when rendering menu
Add original fix by @saqlainsyed007
1 parent eeb1e47 commit 463984d

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ Contributors (based on gitlog, 537 unique authors):
459459
* Samuel Lahti
460460
* Samuel Luescher
461461
* Samuel Lüscher
462+
* saqlainsyed007
462463
* sbussetti
463464
* Schoen
464465
* scottbarnham
@@ -495,6 +496,7 @@ Contributors (based on gitlog, 537 unique authors):
495496
* Stephan Hepper
496497
* Stephan Herzog
497498
* Stephan Jaekel
499+
* Stephan Michaud
498500
* Stephen Muss
499501
* Stephen Paulger
500502
* Stephen Watkin

cms/templatetags/cms_js_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def render_cms_structure_js(context, renderer, obj):
4646
}
4747

4848
if static_placeholder.site_bound:
49-
kwargs['site'] = renderer.current_site.pk
49+
kwargs['site'] = renderer.current_site
5050
else:
5151
kwargs['site_id__isnull'] = True
5252

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% load cms_tags %}
2+
3+
{% cms_toolbar %}
4+
5+
{% static_placeholder 'test-static' site %}

cms/tests/test_site.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,12 @@ def test_site_publish(self):
110110
page_url = page.get_absolute_url(language='de')
111111
response = self.client.get(page_url)
112112
self.assertEqual(response.status_code, 200)
113+
114+
def test_create_site_specific_placeholder(self):
115+
with self.settings(
116+
CMS_TEMPLATES=(('placeholder_tests/static_with_site.html', 'tpl'), ),
117+
):
118+
page = create_page('page', 'placeholder_tests/static_with_site.html', language='de')
119+
120+
response = self.client.get(page.get_absolute_url(language='de') + u'?structure')
121+
self.assertEqual(response.status_code, 200)

0 commit comments

Comments
 (0)
0