diff --git a/elections2021/models.py b/elections2021/models.py index 84db38d26dd4c8f94a6ff95fca796cbcb1365223..d680316e7b1212e16237faf7fa590fee0247cd97 100644 --- a/elections2021/models.py +++ b/elections2021/models.py @@ -1,4 +1,5 @@ import json +import re from functools import cached_property from django import forms @@ -1696,6 +1697,11 @@ class Elections2021ProgramPointPage(SubpageMixin, MetadataPageMixin, Page): class Meta: verbose_name = "ProgramovĂ˝ bod" + def get_meta_description(self): + if self.search_description: + return self.search_description + return re.sub(r"<.*?>|\[.*?\]", "", self.annotation) + @property def archetype(self): if self.weight_ministry_transport: diff --git a/majak/settings/base.py b/majak/settings/base.py index 13e42d36b878c72689689e500f4c484e0e6d605c..20090bac97dc13c11bcfbec1cdfa2a13d4fe248f 100644 --- a/majak/settings/base.py +++ b/majak/settings/base.py @@ -240,6 +240,8 @@ CAPTCHA_LETTER_ROTATION = (-20, 20) CAPTCHA_FONT_SIZE = 30 CAPTCHA_IMAGE_SIZE = (120, 47) +# meta image size +WAGTAILMETADATA_IMAGE_FILTER = "max-1600x1600" # CUSTOM APPS SETTINGS # ------------------------------------------------------------------------------