修复错误的测试 url 名称修改导致

This commit is contained in:
virusdefender
2015-08-14 10:21:22 +08:00
parent 7f3044086f
commit f3be10161f

View File

@@ -3,7 +3,7 @@ from functools import wraps
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import render from django.shortcuts import render
from utils.shortcuts import error_response from utils.shortcuts import error_response, error_page
from .models import User from .models import User
@@ -18,7 +18,7 @@ def login_required(func):
if request.is_ajax(): if request.is_ajax():
return error_response(u"请先登录") return error_response(u"请先登录")
else: else:
return render(request, "utils/error.html", {"error": u"请先登录"}) return error_page(request, u"请先登录")
return check return check
@@ -31,5 +31,5 @@ def admin_required(func):
if request.is_ajax(): if request.is_ajax():
return error_response(u"需要管理员权限") return error_response(u"需要管理员权限")
else: else:
return render(request, "utils/error.html", {"error": "需要管理员权限"}) return error_page(request, u"需要管理员权限")
return check return check