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

[#826] - get() returned more than one Tag -- it returned 2! #914

Merged
merged 8 commits into from
Sep 28, 2024

Conversation

fazeelghafoor
Copy link
Contributor

Fixes #826

  • add check for MultipleObjectsReturned exception returning only the first tag when get() returns more than one
  • add deduplicate_tags management command which keep the first tag and merge all duplicates into it (relationships), then delete the duplicates.
  • add test for deduplicate_tags command

@fazeelghafoor
Copy link
Contributor Author

@rtpg please review and let me know if any changes required.

@rtpg rtpg force-pushed the feat/resolve-duplicate-tags branch from 09aa305 to e851a84 Compare September 28, 2024 06:34
Copy link

codecov bot commented Sep 28, 2024

Codecov Report

Attention: Patch coverage is 71.73913% with 13 lines in your changes missing coverage. Please review.

Project coverage is 90.95%. Comparing base (d0fe810) to head (5835dcb).
Report is 50 commits behind head on master.

Files with missing lines Patch % Lines
taggit/management/commands/deduplicate_tags.py 76.19% 9 Missing and 1 partial ⚠️
taggit/managers.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #914      +/-   ##
==========================================
+ Coverage   89.21%   90.95%   +1.73%     
==========================================
  Files           9       11       +2     
  Lines         779      851      +72     
  Branches      142      157      +15     
==========================================
+ Hits          695      774      +79     
+ Misses         62       52      -10     
- Partials       22       25       +3     
Flag Coverage Δ
90.95% <71.73%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rtpg rtpg force-pushed the feat/resolve-duplicate-tags branch from 5835dcb to 9c1538b Compare September 28, 2024 06:40
@rtpg rtpg force-pushed the feat/resolve-duplicate-tags branch from 9c1538b to 0e3c865 Compare September 28, 2024 06:41
@rtpg
Copy link
Contributor

rtpg commented Sep 28, 2024

Thanks for the PR! I made some changes to simplify the management command and make it explicit that the ordering is always by pk (though that's a bit spurious given the behavior of first).

@rtpg rtpg merged commit 0cd1f24 into jazzband:master Sep 28, 2024
7 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.

get() returned more than one Tag -- it returned 2!
2 participants