mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-16 17:28:11 +00:00
Fix for string form fields (#10814)
* Fix for string form fields - replace null values with empty strings * Expose more serializer metadata * Check if null values are not allowed * Fix type * Try removing feature * Reduce deltas * Remove extra field attrs entirely (for testing) * Comment out changes * Tweak form values * Fix for form validation
This commit is contained in:
@@ -420,6 +420,13 @@ class InvenTreeMetadata(SimpleMetadata):
|
||||
if field_info['type'] == 'dependent field':
|
||||
field_info['depends_on'] = field.depends_on
|
||||
|
||||
# Extends with extra attributes from the serializer
|
||||
extra_field_attributes = ['allow_blank', 'allow_null']
|
||||
|
||||
for attr in extra_field_attributes:
|
||||
if hasattr(field, attr):
|
||||
field_info[attr] = getattr(field, attr)
|
||||
|
||||
# Extend field info if the field has a get_field_info method
|
||||
if (
|
||||
not field_info.get('read_only')
|
||||
|
||||
Reference in New Issue
Block a user