update to django 2.0

This commit is contained in:
virusdefender
2019-03-11 11:25:10 +08:00
parent f7bd9f16b4
commit 6b7654a0c3
18 changed files with 69 additions and 53 deletions

View File

@@ -35,7 +35,7 @@ class UserProfileAPI(APIView):
判断是否登录, 若登录返回用户信息
"""
user = request.user
if not user.is_authenticated():
if not user.is_authenticated:
return self.success()
show_real_name = False
username = request.GET.get("username")
@@ -280,7 +280,7 @@ class UserChangePasswordAPI(APIView):
class ApplyResetPasswordAPI(APIView):
@validate_serializer(ApplyResetPasswordSerializer)
def post(self, request):
if request.user.is_authenticated():
if request.user.is_authenticated:
return self.error("You have already logged in, are you kidding me? ")
data = request.data
captcha = Captcha(request)