Skip to content

Commit

Permalink
Fix some linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Coperh committed Jun 5, 2023
1 parent cd5b9b2 commit 4bb637c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions djangocms_page_meta/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.core.exceptions import ObjectDoesNotExist
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.utils.translation import get_language_from_request
Expand Down Expand Up @@ -143,51 +144,51 @@ def get_page_meta(page, language):
try:
header = plugin.plugins_introheader
meta.image = header.image.url
break;
break
except ObjectDoesNotExist:
pass

# Person header header
try:
header = plugin.plugins_personheader
meta.image = header.person.photo.url
break;
break
except ObjectDoesNotExist:
pass

# Theme header
try:
header = plugin.plugins_themeheader
meta.image = header.image.url
break;
break
except ObjectDoesNotExist:
pass

# Longread header
try:
header = plugin.plugins_longreadheader
meta.image = header.image.url
break;
break
except ObjectDoesNotExist:
pass

# Journal header
try:
header = plugin.plugins_journalheader
meta.image = header.image.url
break;
break
except ObjectDoesNotExist:
pass

try:
media = plugin.plugins_media
meta.image = media.image.url
break;
break
except ObjectDoesNotExist:
pass

if meta.image:
break;
break
# GET IMAGE FROM PAGE ##############################################################
for item in pagemeta.extra.all():
attribute = item.attribute
Expand Down

0 comments on commit 4bb637c

Please sign in to comment.