Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required field raises "invalid literal for int() with base 10'' in admin #4

Open
beheh opened this issue Feb 26, 2020 · 0 comments
Open

Comments

@beheh
Copy link
Contributor

beheh commented Feb 26, 2020

In the Django admin, when leaving a dropdown field with null=True but blank=False on the default selection of "---------", line 28 in the following code raises invalid literal for int() with base 10':

def format_value(self, value):
if value is not None:
value = int(value)
return super().format_value(value)

This is probably happening because the value is an empty string in this case, which should probably be treated like None in the affected function since an enum can't have a member with the empty string as name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant