This commit is contained in:
Egyed Zoltán 2018-09-25 16:14:22 +00:00 committed by GitHub
commit f26b60d12a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,8 @@ def convert_django_field_with_choices(field, registry=None):
return named_choices_descriptions[self.name]
enum = Enum(name, list(named_choices), type=EnumWithDescriptionsType)
converted = enum(description=field.help_text, required=not field.null)
required = not (field.blank or field.null or field.default)
converted = enum(description=field.help_text, required=required)
else:
converted = convert_django_field(field, registry)
if registry is not None: