Add a comment

This commit is contained in:
Oliver 2021-06-28 21:09:48 +10:00
parent 4dbd770f2d
commit f0f6c7d186

View File

@ -59,6 +59,11 @@ class InvenTreeModelSerializer(serializers.ModelSerializer):
for field_name, field in fields.fields.items():
"""
Update the field IF (and ONLY IF):
- The field has a specified default value
- The field does not already have a value set
"""
if field.has_default() and field_name not in data:
value = field.default