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

Removing required='' for FileFields that have a value set #38

Merged
merged 3 commits into from Oct 6, 2018

Conversation

nickdjones
Copy link
Contributor

@nickdjones nickdjones commented Oct 2, 2018

This fixes issue #37 . When you're editing a model with a FileField that is set to required, if there is a file already saved having required in the HTML means it always says This field is required regardless. Due to the slightly different way that FileFields work in that we can leave them blank and it won't empty the field, we can simply remove the required attribute when the field already has a value.

@sveetch
Copy link
Owner

sveetch commented Oct 2, 2018

Looks nice, thank you for your contribution. I will review this at next week end.

@nickdjones
Copy link
Contributor Author

Added ImageField in too

@sveetch sveetch merged commit 3ac029e into sveetch:master Oct 6, 2018
@sveetch
Copy link
Owner

sveetch commented Oct 6, 2018

Will be in next release soon

@nickdjones
Copy link
Contributor Author

Great thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants