feat: quastat sflog create 不需要 belong_dept
This commit is contained in:
parent
51737bcdd8
commit
13b0204c6b
|
@ -31,8 +31,10 @@ class QuaStatSfLogSerializer(CustomModelSerializer):
|
|||
class Meta:
|
||||
model = QuaStat
|
||||
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):
|
||||
sflog = attrs['sflog']
|
||||
attrs['type'] = 'sflog'
|
||||
attrs['belong_dept'] = sflog.mgroup.belong_dept
|
||||
return attrs
|
Loading…
Reference in New Issue