Wrap render_to_response

(imported from commit d23aa3e5ad4c5243e83df098953ea4b1f7b3c294)
This commit is contained in:
Zev Benjamin 2013-05-21 12:15:07 -04:00
parent 55b29291c9
commit ae9be7298d
3 changed files with 8 additions and 4 deletions

View File

@ -5,12 +5,11 @@
__revision__ = '$Id: views.py 21 2008-12-05 09:21:03Z jarek.zgoda $'
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.conf import settings
from confirmation.models import Confirmation
from zephyr.lib.response import render_to_response
def confirm(request, confirmation_key):
confirmation_key = confirmation_key.lower()

View File

@ -1,6 +1,7 @@
from __future__ import absolute_import
from django.http import HttpResponse, HttpResponseNotAllowed
import django.shortcuts
import simplejson
class HttpResponseUnauthorized(HttpResponse):
@ -28,3 +29,6 @@ def json_success(data={}):
def json_error(msg, data={}, status=400):
return json_response(res_type="error", msg=msg, data=data, status=status)
def render_to_response(template, *args, **kwargs):
return django.shortcuts.render_to_response(template, *args, **kwargs)

View File

@ -5,7 +5,7 @@ from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, redirect
from django.shortcuts import redirect
from django.template import RequestContext, loader
from django.utils.timezone import now
from django.core.exceptions import ValidationError
@ -46,7 +46,8 @@ from zephyr.decorator import require_post, \
authenticated_rest_api_view, process_as_post, REQ
from zephyr.lib.query import last_n
from zephyr.lib.avatar import gravatar_hash
from zephyr.lib.response import json_success, json_error, json_response, json_method_not_allowed
from zephyr.lib.response import json_success, json_error, json_response, json_method_not_allowed, \
render_to_response
from zephyr.lib.timestamp import datetime_to_timestamp
from zephyr.lib.cache import cache_with_key, cache_get_many, cache_set_many
from zephyr.lib.unminify import SourceMap