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

Potential fix for a problem #4

Open
corentinbettiol opened this issue Feb 6, 2024 · 2 comments
Open

Potential fix for a problem #4

corentinbettiol opened this issue Feb 6, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@corentinbettiol
Copy link

Hi, we saw that you're hosting a new version of django-file-resubmit.

Starting with django 4.2, an old ticket was fixed, and it broke a feature of django-file-resubmit (the "keep the file in the field" one).

We went in a rabbit hole with a coworker, and found that you need to undo the fix in order to fix the feature:

class FixedClearableFileInput(forms.FileField):
    def bound_data(self, data, initial):
        return data

# ...

class OurSuperForm(SomeOtherForm):
    logo = FixedClearableFileInput()

See more info on the issue of django-file-resubmit.

@corentinbettiol corentinbettiol added the enhancement New feature or request label Feb 6, 2024
@mouse-reeve
Copy link
Member

Thank you so much for the update! We aren't on 4.x yet, but this is going to be invaluable when we are

@corentinbettiol
Copy link
Author

Hi, no problem :)
The fix should be backwards compatible (since it only affects a change made in 4.2 by reverting it like it was in versions 2 or 3 of Django), so you could implement it right now :)

And thank you for bookwyrm, it's an incredible part of the federated web :)

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

No branches or pull requests

2 participants