Skip to content

Commit

Permalink
Fixed DontUsePageAttributeWarning message (django-cms#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
fp4code authored and czpython committed Dec 17, 2017
1 parent 78c8960 commit 338c6fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion djangocms_link/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ def get_link(self):
ref_page = self.internal_link
link = ref_page.get_absolute_url()

if ref_page.site_id != getattr(self.page, 'site_id', None):
# simulate the call to the unauthorized CMSPlugin.page property
cms_page = self.placeholder.page if self.placeholder_id else None
if ref_page.site_id != getattr(cms_page, 'site_id', None):
ref_site = Site.objects._get_site_by_id(ref_page.site_id).domain
link = '//{}{}'.format(ref_site, link)
elif self.external_link:
Expand Down

0 comments on commit 338c6fc

Please sign in to comment.