mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Typo fixes
This commit is contained in:
parent
ae1a1e139f
commit
8913b74f41
@ -58,7 +58,7 @@ class InvenTreeModelSerializer(serializers.ModelSerializer):
|
||||
|
||||
for field_name, field in fields.fields.items():
|
||||
|
||||
if field.has_default():
|
||||
if field.has_default() and field_name not in initials:
|
||||
|
||||
value = field.default
|
||||
|
||||
@ -87,7 +87,7 @@ class InvenTreeModelSerializer(serializers.ModelSerializer):
|
||||
for field_name, field in fields.fields.items():
|
||||
|
||||
if field.has_default():
|
||||
if field not in self._validated_data:
|
||||
if field_name not in self._validated_data.keys():
|
||||
|
||||
value = field.default
|
||||
|
||||
@ -97,7 +97,6 @@ class InvenTreeModelSerializer(serializers.ModelSerializer):
|
||||
|
||||
self._validated_data[field_name] = value
|
||||
|
||||
|
||||
return valid
|
||||
|
||||
def run_validation(self, data=empty):
|
||||
|
Loading…
Reference in New Issue
Block a user