admin webpack template
This commit is contained in:
@@ -7,9 +7,12 @@ from django.http import HttpResponseRedirect, HttpResponse
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.contrib import auth
|
||||
|
||||
from .models import AdminType
|
||||
from .models import AdminType, User
|
||||
|
||||
|
||||
# todo remove this
|
||||
from django.contrib import auth
|
||||
|
||||
class SessionSecurityMiddleware(object):
|
||||
def process_request(self, request):
|
||||
if request.user.is_authenticated() and request.user.admin_type in [AdminType.ADMIN, AdminType.SUPER_ADMIN]:
|
||||
|
||||
@@ -64,6 +64,11 @@ class UserLoginAPIView(APIView):
|
||||
else:
|
||||
return serializer_invalid_response(serializer)
|
||||
|
||||
# todo remove this
|
||||
def get(self, request):
|
||||
auth.login(request, auth.authenticate(username="root", password="123456"))
|
||||
return success_response({})
|
||||
|
||||
|
||||
class UserRegisterAPIView(APIView):
|
||||
def post(self, request):
|
||||
|
||||
Reference in New Issue
Block a user