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

Enhancement: detect duplicates at entry time #23

Closed
t-jones opened this issue Jun 29, 2020 · 2 comments · Fixed by #29
Closed

Enhancement: detect duplicates at entry time #23

t-jones opened this issue Jun 29, 2020 · 2 comments · Fixed by #29
Labels
enhancement New feature or request

Comments

@t-jones
Copy link

t-jones commented Jun 29, 2020

Thanks for this great app. Perfect for managing a bunch of bookmarks.

What do you think about a warning/message when trying to bookmark a page that's already bookmarked? If that sounds good, give me a couple pointers and I'll give you a PR.

@ashadulhoque
Copy link

For quick fix replacing line 32 of bookmarks/models.py from 'url = models.URLField()' to 'url = models.URLField(unique=True)' will prevent duplicate urls from inserting into the database.This is what I am doing right now.

Ideally, instead of trying to insert into database the app should update existing record in case of duplicate urls or even better display existing fields and save updates if any.

sissbruecker added a commit that referenced this issue Sep 13, 2020
* Show hint if URL is already bookmarked

* Remove hint if URL belongs to edited bookmark

* Fix query param encoding

* Update bookmark instead of duplicating it

Co-authored-by: Sascha Ißbrücker <sissbruecker@lyska.io>
@sissbruecker
Copy link
Owner

sissbruecker commented Sep 13, 2020

Added some handling for this. The form will now check (from client-side, after entering the URL) if the URL is already bookmarked and then show a hint below the input:

Bildschirmfoto 2020-09-13 um 08 38 08

The hint provides the option to edit the original bookmark.

If the form is saved regardless, then the existing bookmark is updated instead of creating a new one.

@sissbruecker sissbruecker added the enhancement New feature or request label Dec 31, 2020
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

Successfully merging a pull request may close this issue.

3 participants