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

Feature: owner-aware unique model name constraint #2827

Merged
merged 4 commits into from Mar 10, 2023

Conversation

shamoon
Copy link
Member

@shamoon shamoon commented Mar 4, 2023

Proposed change

As was pointed out in the linked discussion, with permissions added, uniqueness by model name should be owner-aware ie two different owners can have the same tag name. The second UniqueConstraint is to handle null owner. Also this is enforced via the API when owner is changed using serializer. Hopefully the test coverage is up-to-snuff.

Please let me know if I've missed anything as I dabble in the backend world.

Fixes #2802

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please explain)

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

@shamoon shamoon requested a review from a team as a code owner March 4, 2023 23:14
@paperless-ngx-secretary paperless-ngx-secretary bot added backend non-trivial Requires approval by several team members labels Mar 4, 2023
@github-actions github-actions bot added the enhancement New feature label Mar 4, 2023
@shamoon shamoon added this to the v1.14 milestone Mar 7, 2023
@shamoon shamoon force-pushed the feature-owner-aware-unique-model-names branch from 40d6fa2 to 98953d8 Compare March 8, 2023 23:14
@shamoon shamoon force-pushed the feature-owner-aware-unique-model-names branch from 98953d8 to 92907a3 Compare March 9, 2023 03:07
@shamoon shamoon force-pushed the feature-owner-aware-unique-model-names branch from 92907a3 to c4ac351 Compare March 9, 2023 04:16
@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

Merging #2827 (5e7b93d) into dev (2fe7f8b) will decrease coverage by 0.05%.
The diff coverage is 86.66%.

@@            Coverage Diff             @@
##              dev    #2827      +/-   ##
==========================================
- Coverage   93.14%   93.09%   -0.05%     
==========================================
  Files         149      150       +1     
  Lines        6387     6401      +14     
==========================================
+ Hits         5949     5959      +10     
- Misses        438      442       +4     
Flag Coverage Δ
backend 93.09% <86.66%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
src/documents/serialisers.py 91.44% <63.63%> (-0.71%) ⬇️
...documenttype_options_alter_tag_options_and_more.py 100.00% <100.00%> (ø)
src/documents/models.py 98.32% <100.00%> (-0.01%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shamoon
Copy link
Member Author

shamoon commented Mar 9, 2023

Thanks, sorry for not including comments before, that does make it much more understandable

@shamoon shamoon merged commit 2042b85 into dev Mar 10, 2023
@shamoon shamoon deleted the feature-owner-aware-unique-model-names branch March 10, 2023 06:34
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend enhancement New feature non-trivial Requires approval by several team members
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants