flake8
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
import functools
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from utils.api import JSONResponse
|
||||
|
||||
@@ -23,4 +23,4 @@ class AdminRequiredMiddleware(object):
|
||||
path = request.path_info
|
||||
if path.startswith("/admin/") or path.startswith("/api/admin/"):
|
||||
if not(request.user.is_authenticated() and request.user.is_admin()):
|
||||
return JSONResponse.response({"error": "login-required", "data": _("Please login in first")})
|
||||
return JSONResponse.response({"error": "login-required", "data": _("Please login in first")})
|
||||
|
||||
@@ -3,5 +3,5 @@ from django.conf.urls import url
|
||||
from ..views.admin import UserAdminAPI
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^user$', UserAdminAPI.as_view(), name="user_admin_api"),
|
||||
url(r"^user$", UserAdminAPI.as_view(), name="user_admin_api"),
|
||||
]
|
||||
|
||||
@@ -3,7 +3,7 @@ from django.conf.urls import url
|
||||
from ..views.oj import UserLoginAPI, UserRegisterAPI, UserChangePasswordAPI
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^login$', UserLoginAPI.as_view(), name="user_login_api"),
|
||||
url(r'^register$', UserRegisterAPI.as_view(), name="user_register_api"),
|
||||
url(r'^change_password$', UserChangePasswordAPI.as_view(), name="user_change_password_api")
|
||||
url(r"^login$", UserLoginAPI.as_view(), name="user_login_api"),
|
||||
url(r"^register$", UserRegisterAPI.as_view(), name="user_register_api"),
|
||||
url(r"^change_password$", UserChangePasswordAPI.as_view(), name="user_change_password_api")
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user