Skip to content

Commit

Permalink
fixed django-cms#183: AttributeError: 'Page' object has no attribute …
Browse files Browse the repository at this point in the history
…'site' (django-cms#184)

Co-authored-by: Jan Hangebrauck <[email protected]>
  • Loading branch information
CaptainChaos and Jan Hangebrauck authored May 12, 2020
1 parent 7cb7cb2 commit 9e20611
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions djangocms_link/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def render(self, context, instance, placeholder):
def get_form(self, request, obj=None, **kwargs):
form_class = super(LinkPlugin, self).get_form(request, obj, **kwargs)

if obj and obj.page and obj.page.site:
if obj and obj.page and hasattr(obj.page, 'site') and obj.page.site:
site = obj.page.site
elif self.page and self.page.site:
elif self.page and hasattr(self.page, 'site') and self.page.site:
site = self.page.site
else:
site = Site.objects.get_current()
Expand Down

0 comments on commit 9e20611

Please sign in to comment.