Skip to content

Commit

Permalink
catch badly formed settings.DISTILL_LANGUAGES entries
Browse files Browse the repository at this point in the history
  • Loading branch information
meeb committed May 25, 2024
1 parent 955f322 commit b9f37b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django_distill/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def get_langs(self):
default_lang = str(getattr(settings, 'LANGUAGE_CODE', 'en'))
try:
DISTILL_LANGUAGES = list(getattr(settings, 'DISTILL_LANGUAGES', []))
except (ValueError, TypeError):
except (ValueError, TypeError, AttributeError):
DISTILL_LANGUAGES = []
if default_lang not in DISTILL_LANGUAGES:
langs.append(default_lang)
for lang in settings.DISTILL_LANGUAGES:
for lang in DISTILL_LANGUAGES:
langs.append(lang)
return langs

Expand Down

0 comments on commit b9f37b3

Please sign in to comment.