Commit fe925b5e authored by Michal Čihař's avatar Michal Čihař

Allow to render without context

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent de30bca0
...@@ -250,8 +250,10 @@ def get_project_description(project): ...@@ -250,8 +250,10 @@ def get_project_description(project):
) )
def render(request, template, context): def render(request, template, context=None):
"""Wrapper around Django render to extend context""" """Wrapper around Django render to extend context"""
if context is None:
context = {}
if 'project' in context: if 'project' in context:
context['description'] = get_project_description(context['project']) context['description'] = get_project_description(context['project'])
return django_render(request, template, context) return django_render(request, template, context)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment