Skip to content

Commit

Permalink
contrib:contrib_tags: add if so server doesn't error when trying to f…
Browse files Browse the repository at this point in the history
…etch context
  • Loading branch information
philli-m committed Oct 26, 2023
1 parent 840e30d commit ab71891
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/contrib/templatetags/contrib_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit ab71891

Please sign in to comment.