Skip to content

Conversation

ShubhamSingh20
Copy link
Contributor

Added use_required_attribute() method to FileInput widget, this will remove the required attribute if initial data is provided to the FileField.

@felixxm
Copy link
Member

felixxm commented Jan 6, 2020

Documentation changes and tests are required.

Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@ShubhamSingh20 Thanks 👍 I left comments.

Changes are missing in the Widget.use_required_attribute() docs, e.g.

        otherwise. Special cases are :class:`~django.forms.ClearableFileInput`,
        and :class:`~django.forms.FileInput` which return `False` ...

also versionchanged annotation is missing.

Please remove ClearableFileInput.use_required_attribute() it's not necessary anymore, because ClearableFileInput inherits from FileInput.

@ShubhamSingh20
Copy link
Contributor Author

Changes are missing in the Widget.use_required_attribute() docs, e.g.

        otherwise. Special cases are :class:`~django.forms.ClearableFileInput`,
        and :class:`~django.forms.FileInput` which return `False` ...

also versionchanged annotation is missing.

Should the versionchanged annotation, specify version 3.0 ?

@felixxm
Copy link
Member

felixxm commented Jan 7, 2020

Should the versionchanged annotation, specify version 3.0 ?

No, 3.1.

@ShubhamSingh20
Copy link
Contributor Author

Should the versionchanged annotation, specify version 3.0 ?

No, 3.1.

okay. I will change it accordingly

@felixxm felixxm self-assigned this Jan 8, 2020
@felixxm felixxm changed the title Fixed #31118 -- Removes required attribute if initial data exists in FileInput Fixed #31118 -- Made FileInput to avoid the required attribute when initial data exists. Jan 8, 2020
@felixxm
Copy link
Member

felixxm commented Jan 8, 2020

@ShubhamSingh20 Thanks 👍 I pushed minor edits to tests and docs, and added release notes.

@felixxm felixxm merged commit ffcf1a8 into django:master Jan 8, 2020
@ShubhamSingh20
Copy link
Contributor Author

@felixxm Thanks 👍. For helping out.

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.

2 participants