mirror of
https://github.com/ansible/awx.git
synced 2026-02-02 10:08:10 -03:30
Update CTiT serializer integer field to handle html cornercase.
This commit is contained in:
@@ -31,6 +31,16 @@ class CharField(CharField):
|
||||
return super(CharField, self).to_representation(value)
|
||||
|
||||
|
||||
class IntegerField(IntegerField):
|
||||
|
||||
def get_value(self, dictionary):
|
||||
ret = super(IntegerField, self).get_value(dictionary)
|
||||
# Handle UI corner case
|
||||
if ret == '' and self.allow_null and not getattr(self, 'allow_blank', False):
|
||||
return None
|
||||
return ret
|
||||
|
||||
|
||||
class StringListField(ListField):
|
||||
|
||||
child = CharField()
|
||||
|
||||
Reference in New Issue
Block a user