Skip to content
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

Multiple static placeholders in single page throws error. #6729

Open
agajankush opened this issue Sep 4, 2019 · 1 comment

Comments

@agajankush
Copy link

commented Sep 4, 2019

Summary

Expected behaviour

Actual behaviour

Environment

  • Python version:
  • Django version:
  • django CMS version:

@agajankush agajankush changed the title Multiple static placeholders in single page throws error Multiple static placeholders in single page throws error. Sep 4, 2019

@agajankush

This comment has been minimized.

Copy link
Author

commented Sep 4, 2019

The error is,
ValueError: Cannot assign "1": "StaticPlaceholder.site" must be a "Site" instance.
I fixed the issue in my project by changing below thing in "cms/templatetags/cms_js_tags.py" in function "render_cms_structure_js" line 49.

Before
kwargs['site'] = renderer.current_site.pk

After
kwargs['site_id'] = renderer.current_site.pk

This kwargs is used in get_or_create(**kwargs) function below which is a standard django function and it requires either the site object or the site_id for getting or creating StaticPlaceholder object.
Hope this helps someone !!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.