Skip to content

Fix FilePathField required argument #8805

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

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

radekwlsk
Copy link
Contributor

Description

Following on the discussion in #8804 this PR fixes required argument lost in FilePathField constructor by making sure it is passed to the super().__init__ call with other keyword arguments.

@radekwlsk
Copy link
Contributor Author

@auvipy Not sure what the CI error is. Seems that deprecation warnings are making it fail?

@auvipy
Copy link
Member

auvipy commented Dec 21, 2022

can you please check why the CI is failing?? might be unrelated to this PR after checking the error message though

@auvipy
Copy link
Member

auvipy commented Dec 21, 2022

I think we should get rid of python 3.6 now from CI

@radekwlsk
Copy link
Contributor Author

radekwlsk commented Dec 21, 2022

@auvipy Also I wonder if setting allow_blank=False together with required=False should remove ("", "---------") from path choices. As currently django's FilePathField will add it whenever required=False and that will make "" a valid choice and skip allow_blank=False.

Not sure of the expected behaviour though, as it is based on ChoiceField and that does not support allow_blank, right?

@auvipy
Copy link
Member

auvipy commented Dec 21, 2022

we should align with django mainly

@radekwlsk
Copy link
Contributor Author

Waiting for CI fix on master.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just pull from main branch

@radekwlsk radekwlsk force-pushed the fix-filepathfield-required branch from cc50963 to 2bd0008 Compare January 4, 2023 15:05
@auvipy auvipy added the Bug label Jan 4, 2023
@auvipy auvipy merged commit 89d6ce7 into encode:master Jan 4, 2023
@auvipy auvipy added this to the 3.15 milestone Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants