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

Rely on database unique constraints #248

Merged
merged 2 commits into from
Feb 17, 2022

Conversation

jchristgit
Copy link
Collaborator

PR #245 updated the validators to check for duplicate usernames and
emails by running a query before posting the data. Let's rely on the
database indexes instead, which is more robust. This builds on top of
PR #245's tests to verify the functionality.

PR #245 updated the validators to check for duplicate usernames and
emails by running a query before posting the data. Let's rely on the
database indexes instead, which is more robust. This builds on top of
PR #245's tests to verify the functionality.
@jchristgit jchristgit added the enhancement New feature or request label Feb 17, 2022
@jchristgit jchristgit requested a review from 0xAda February 17, 2022 22:00
Copy link
Contributor

@0xAda 0xAda left a comment

Choose a reason for hiding this comment

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

LGTM!

@0xAda 0xAda enabled auto-merge (squash) February 17, 2022 22:01
@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #248 (83a6869) into master (f069a1e) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
+ Coverage   96.51%   96.55%   +0.04%     
==========================================
  Files         108      108              
  Lines        4966     4969       +3     
  Branches      265      264       -1     
==========================================
+ Hits         4793     4798       +5     
+ Misses        140      139       -1     
+ Partials       33       32       -1     
Impacted Files Coverage Δ
src/authentication/basic_auth.py 100.00% <ø> (ø)
src/authentication/providers.py 100.00% <ø> (ø)
src/authentication/views.py 100.00% <100.00%> (ø)
src/team/serializers.py 100.00% <100.00%> (ø)
src/backend/exception_handler.py 81.08% <0.00%> (+5.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f069a1e...83a6869. Read the comment docs.

@0xAda 0xAda merged commit bd27043 into master Feb 17, 2022
@0xAda 0xAda deleted the prevent-race-conditions-for-duplicate-names branch February 17, 2022 22:05
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 this pull request may close these issues.

3 participants