diff --git a/apps/contrib/templatetags/contrib_tags.py b/apps/contrib/templatetags/contrib_tags.py index d6a51a1c..19d83574 100644 --- a/apps/contrib/templatetags/contrib_tags.py +++ b/apps/contrib/templatetags/contrib_tags.py @@ -113,6 +113,8 @@ def translate_url(context, lang=None, *args, **kwargs): Usage: {% translate_url 'en' %} """ + if not hasattr(context, "request"): + return '' path = context['request'].path cur_language = translation.get_language()