nephila / djangocms-page-meta

OpenGraph, Twitter Card and Google+ snippet tags for django CMS 3 pages
https://djangocms-page-meta.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
60 stars 64 forks source link

fix compatibility for django_meta==2.4.0 #178

Closed wfehr closed 1 year ago

wfehr commented 1 year ago

See django-meta commit:

The variables got renamed and prefixed with META_.

The current version of djangocms-page-meta still requests those settings without the newly added prefix, e.g. FB_TYPE instead of META_FB_TYPE.

Little part of a trace:

  File "/usr/local/lib/python3.11/site-packages/djangocms_page_meta/templatetags/page_meta_tags.py", line 25, in render_tag
    meta = get_page_meta(page, language)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/djangocms_page_meta/utils.py", line 85, in get_page_meta
    "object_type": meta_settings.FB_TYPE,
                   ^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'meta.settings' has no attribute 'FB_TYPE'
wfehr commented 1 year ago

Best might be to use meta.settings.get_setting, e.g. ..get_settings("FB_TYPE") which will handle the prefix. -> this was introduced in django-meta==2.4.0.

protoroto commented 1 year ago

@wfehr We've just released version 1.4.2 . This should be fixed now! Thanks for poiting this out!