feat: quastat sflog create 不需要 belong_dept
This commit is contained in:
parent
51737bcdd8
commit
13b0204c6b
|
|
@ -31,8 +31,10 @@ class QuaStatSfLogSerializer(CustomModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = QuaStat
|
model = QuaStat
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
read_only_fields = EXCLUDE_FIELDS + ['type', 'year', 'month', 'day']
|
read_only_fields = EXCLUDE_FIELDS + ['type', 'year', 'month', 'day', 'belong_dept']
|
||||||
|
|
||||||
def validate(self, attrs):
|
def validate(self, attrs):
|
||||||
|
sflog = attrs['sflog']
|
||||||
attrs['type'] = 'sflog'
|
attrs['type'] = 'sflog'
|
||||||
|
attrs['belong_dept'] = sflog.mgroup.belong_dept
|
||||||
return attrs
|
return attrs
|
||||||
Loading…
Reference in New Issue