Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
skorokithakis committed Aug 12, 2016
2 parents 25f4720 + 94b9814 commit b37607d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions annoying/decorators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.shortcuts import render_to_response
from django.shortcuts import render, render_to_response
from django import forms
from django import VERSION as DJANGO_VERSION
from django.template import RequestContext
Expand Down Expand Up @@ -96,7 +96,10 @@ def wrapper(request, *args, **kwargs):
template_dir = os.path.join(*function.__module__.split('.')[:-1])
tmpl = os.path.join(template_dir, function.func_name + ".html")
# Explicit version check to avoid swallowing other exceptions
if DJANGO_VERSION[0] >= 1 and DJANGO_VERSION[1] >= 5:
if DJANGO_VERSION >= (1, 9):
return render(request, tmpl, output,
content_type=content_type or mimetype)
elif DJANGO_VERSION >= (1, 5):
return render_to_response(tmpl, output,
context_instance=RequestContext(request),
content_type=content_type or mimetype)
Expand Down

0 comments on commit b37607d

Please sign in to comment.