fix: door_auth bulk_create id bug
This commit is contained in:
parent
af105384fe
commit
6b6175803c
|
|
@ -233,11 +233,13 @@ class HrmService:
|
|||
# raise APIException(**DH_REQUEST_ERROR)
|
||||
cls.save(ep, data={'dh_dchannels': dh_dchannels})
|
||||
from apps.third.models import DoorAuth
|
||||
from apps.utils.snowflake import idWorker
|
||||
DoorAuth.objects.filter(employee=ep).delete()
|
||||
drs = []
|
||||
for i in dh_dchannels:
|
||||
id = idWorker.get_id()
|
||||
drs.append(
|
||||
DoorAuth(employee=ep, dchannel=TDevice.objects.get(code=i)))
|
||||
DoorAuth(id=id, employee=ep, dchannel=TDevice.objects.get(code=i)))
|
||||
DoorAuth.objects.bulk_create(drs)
|
||||
return dh_dchannels
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue