feat: ResignationSerializer create bug2

This commit is contained in:
caoqianming 2025-11-24 15:34:30 +08:00
parent 2dbd7da2f8
commit 873e4bd80e
1 changed files with 4 additions and 0 deletions

View File

@ -327,6 +327,10 @@ class ResignationSerializer(CustomModelSerializer):
model = Resignation
fields = '__all__'
def update(self, instance, validated_data):
validated_data.pop('employee')
return super().update(instance, validated_data)
def create(self, validated_data):
employee:Employee = validated_data['employee']
if employee.job_state == Employee.JOB_ON: