Skip to content

Commit

Permalink
Treat case where lang = None to fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
jm9e committed Aug 8, 2017
1 parent 3c252ae commit 1977464
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions django_admin_caching/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ def key(self):

@property
def i18n_l10n_prefix(self):
lang = translation.get_language()
locale = translation.to_locale(lang)
parts = []
lang = translation.get_language()
if lang is None:
lang = ''
locale = ''
else:
locale = translation.to_locale(lang)
if settings.USE_I18N:
parts += [lang]
if settings.USE_L10N:
Expand Down

0 comments on commit 1977464

Please sign in to comment.