SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit f318edb4 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Make automarkup robust to non-template calls

parent 47137851
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ register = template.Library()
@register.simple_tag(takes_context=True)
def automarkup(context, text, language_forced=None):
markup = process_markup(text, language_forced=language_forced)
if markup["errors"] and context["request"]:
if markup["errors"] and "request" in context and context["request"]:
# Create a ticket (if not yet present) flagging the error for page's
# url if automarkup called in template (so if context.request exists)
markup_queue = Queue.objects.get(name="Markup")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment