Commit 5f4e695a authored by Michal Čihař's avatar Michal Čihař

Document rendering

parent 377991f0
......@@ -151,6 +151,7 @@ def render(request, project, widget = '287x66'):
obj = get_object_or_404(Project, slug = project)
percent = obj.get_translated_percent()
# Get widget data
try:
widget_data = WIDGETS[widget]
except KeyError:
......@@ -161,6 +162,7 @@ def render(request, project, widget = '287x66'):
if color not in widget_data['colors']:
color = widget_data['default']
# Prepare response object
response = HttpResponse(mimetype='image/png')
# Background 287 x 66, logo 64 px
......@@ -207,5 +209,7 @@ def render(request, project, widget = '287x66'):
})
ctx.fill()
# Render PNG
surface.write_to_png(response)
return response
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