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

FileLinkForm: fix duplicate check #3311

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

Minnozz
Copy link

@Minnozz Minnozz commented Mar 9, 2024

Reported @ #3295 (comment)

Tested locally; adding links and duplicate checking works.

@Minnozz Minnozz marked this pull request as draft March 9, 2024 14:45
@Minnozz Minnozz marked this pull request as ready for review March 9, 2024 16:00
Copy link
Contributor

@dato dato left a comment

Choose a reason for hiding this comment

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

Thank you for this, the fix looks good to me (tested on my instance as well).

and models.FileLink.objects.filter(
url=url, book=book, filetype=filetype
).exists()
models.FileLink.objects.filter(url=url, book=book, filetype=filetype)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not for this PR, but I would propose dropping filetype from this check. Thoughts?

(If file type is wrong and needs updating, the proposed change would ensure the pre-existing link is deleted first.)

Copy link
Author

Choose a reason for hiding this comment

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

Agreed; I'll change that in a separate PR after this one.

@dato dato merged commit 304c478 into bookwyrm-social:main Mar 11, 2024
10 checks passed
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.

4 participants