校验人脸照片
This commit is contained in:
parent
b04d372e19
commit
e4c4bb09dd
|
@ -1,3 +1,4 @@
|
||||||
|
from inflection import transliterate
|
||||||
from numpy import True_
|
from numpy import True_
|
||||||
from apps.hrm.models import Certificate, Employee
|
from apps.hrm.models import Certificate, Employee
|
||||||
from apps.hrm.serializers import phone_check
|
from apps.hrm.serializers import phone_check
|
||||||
|
@ -9,6 +10,8 @@ from apps.system.serializers import DictSerializer, DictSimpleSerializer, FileSe
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
from rest_framework.exceptions import ParseError
|
from rest_framework.exceptions import ParseError
|
||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
from apps.third.clients import dhClient
|
||||||
|
from apps.third.tapis import dhapis
|
||||||
|
|
||||||
|
|
||||||
class RpartyCreateUpdateSerializer(CustomModelSerializer):
|
class RpartyCreateUpdateSerializer(CustomModelSerializer):
|
||||||
|
@ -98,6 +101,12 @@ class RemployeeCreateSerializer(CustomModelSerializer):
|
||||||
# 'id_number': {'required': True},
|
# 'id_number': {'required': True},
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
def create(self, validated_data):
|
||||||
|
with transaction.atomic():
|
||||||
|
# 校验上传的证件照
|
||||||
|
dhClient.request(**dhapis['person_img_upload'], file_path_rela=validated_data['photo'])
|
||||||
|
return super().create(validated_data)
|
||||||
|
|
||||||
|
|
||||||
class RemployeeSerializer(CustomModelSerializer):
|
class RemployeeSerializer(CustomModelSerializer):
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ class VisitorCreateSerializer(CustomModelSerializer):
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
# 校验上传的证件照
|
# 校验上传的证件照
|
||||||
dhClient.request(**dhapis['person_img_upload'], file_path_rela=validated_data['photo'])
|
dhClient.request(**dhapis['person_img_upload'], file_path_rela=validated_data['photo'])
|
||||||
super().create(validated_data)
|
return super().create(validated_data)
|
||||||
|
|
||||||
|
|
||||||
class VisitorSerializer(CustomModelSerializer):
|
class VisitorSerializer(CustomModelSerializer):
|
||||||
|
|
Loading…
Reference in New Issue