From c2ecb1aa3e89cc98ae8f4a4198a3f600790bf5dc Mon Sep 17 00:00:00 2001 From: youngS Date: Thu, 25 Mar 2021 15:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=B1=E8=B4=A5=E6=9C=AA=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=8A=B6=E6=80=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/api/views/login.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fir_ser/api/views/login.py b/fir_ser/api/views/login.py index 5670f55..e5d276c 100644 --- a/fir_ser/api/views/login.py +++ b/fir_ser/api/views/login.py @@ -5,7 +5,7 @@ from api.utils.serializer import UserInfoSerializer from django.core.cache import cache from rest_framework.views import APIView import binascii -import os, datetime, json +import os, datetime from api.utils.utils import get_captcha, valid_captcha, is_valid_domain, is_valid_phone, \ get_sender_sms_token, is_valid_email, is_valid_sender_code, get_sender_email_token, get_random_username, \ check_username_exists @@ -391,10 +391,12 @@ class UserInfoView(APIView): if username and username != request.user.username: if check_username_exists(username): res.msg = "用户名已经存在" + res.code = 1005 logger.error("User %s info save failed. Excepiton:%s" % (request.user, 'username already exists')) return Response(res.dict) if len(username) < 6: res.msg = "用户名至少6位" + res.code = 1006 return Response(res.dict) request.user.job = data.get("job", request.user.job)