mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
Wrap render_to_response
(imported from commit d23aa3e5ad4c5243e83df098953ea4b1f7b3c294)
This commit is contained in:
@@ -5,12 +5,11 @@
|
|||||||
__revision__ = '$Id: views.py 21 2008-12-05 09:21:03Z jarek.zgoda $'
|
__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.template import RequestContext
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from confirmation.models import Confirmation
|
from confirmation.models import Confirmation
|
||||||
|
from zephyr.lib.response import render_to_response
|
||||||
|
|
||||||
def confirm(request, confirmation_key):
|
def confirm(request, confirmation_key):
|
||||||
confirmation_key = confirmation_key.lower()
|
confirmation_key = confirmation_key.lower()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from django.http import HttpResponse, HttpResponseNotAllowed
|
from django.http import HttpResponse, HttpResponseNotAllowed
|
||||||
|
import django.shortcuts
|
||||||
import simplejson
|
import simplejson
|
||||||
|
|
||||||
class HttpResponseUnauthorized(HttpResponse):
|
class HttpResponseUnauthorized(HttpResponse):
|
||||||
@@ -28,3 +29,6 @@ def json_success(data={}):
|
|||||||
|
|
||||||
def json_error(msg, data={}, status=400):
|
def json_error(msg, data={}, status=400):
|
||||||
return json_response(res_type="error", msg=msg, data=data, status=status)
|
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)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from django.contrib.auth import authenticate, login
|
|||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.http import HttpResponseRedirect
|
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.template import RequestContext, loader
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
@@ -46,7 +46,8 @@ from zephyr.decorator import require_post, \
|
|||||||
authenticated_rest_api_view, process_as_post, REQ
|
authenticated_rest_api_view, process_as_post, REQ
|
||||||
from zephyr.lib.query import last_n
|
from zephyr.lib.query import last_n
|
||||||
from zephyr.lib.avatar import gravatar_hash
|
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.timestamp import datetime_to_timestamp
|
||||||
from zephyr.lib.cache import cache_with_key, cache_get_many, cache_set_many
|
from zephyr.lib.cache import cache_with_key, cache_get_many, cache_set_many
|
||||||
from zephyr.lib.unminify import SourceMap
|
from zephyr.lib.unminify import SourceMap
|
||||||
|
|||||||
Reference in New Issue
Block a user