去除手机号的bug

This commit is contained in:
caoqianming 2022-04-12 14:31:01 +08:00
parent b4db266dd9
commit 69d05b02da
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ class CustomBackend(ModelBackend):
return
try:
user = UserModel._default_manager.get(
Q(username=username) | Q(phone=username) | Q(email=username))
Q(username=username) | Q(email=username))
except UserModel.DoesNotExist:
# Run the default password hasher once to reduce the timing
# difference between an existing and a nonexistent user (#20760).

View File

@ -3,7 +3,7 @@ from rest_framework.serializers import ModelSerializer
from rest_framework import serializers
from apps.utils.serializers import CustomModelSerializer
from apps.utils.constants import EXCLUDE_FIELDS
from .models import ClockRecord, Employee, NotWorkRemark
from apps.system.serializers import DeptSimpleSerializer,UserSimpleSerializer
@ -11,7 +11,7 @@ class EmployeeSerializer(CustomModelSerializer):
belong_dept_ = DeptSimpleSerializer(source='user.belong_dept', read_only=True)
class Meta:
model = Employee
exclude = ['face_data']
exclude = EXCLUDE_FIELDS + ['face_data']
class EmployeeNotWorkRemarkSerializer(ModelSerializer):
class Meta: