mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Merge pull request #5970 from jangsutsr/5628_update_ctit_serializer_fields_to_handle_html_cornercase
Update CTinT 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)
|
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):
|
class StringListField(ListField):
|
||||||
|
|
||||||
child = CharField()
|
child = CharField()
|
||||||
|
|||||||
Reference in New Issue
Block a user