mentorship-backend
mentorship-backend copied to clipboard
Fix: Multiple relation requests from a user to same member
Description
A user was able to send multiple mentorship request to the same member.
So, I added a check on relation.state and returned HTTPS.CONFLICT
Fixes #866
Type of Change:
- Code
Code/Quality Assurance Only
- Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Manually through postman
Ran all tests
Mocks
Checklist:
- [X] My PR follows the style guidelines of this project
- [X] I have performed a self-review of my own code or materials
Code/Quality Assurance Only
- [X] My changes generate no new warnings
Codecov Report
Merging #994 (01393c4) into develop (8f1906e) will decrease coverage by
3.26%
. The diff coverage is83.33%
.
@@ Coverage Diff @@
## develop #994 +/- ##
===========================================
- Coverage 96.14% 92.88% -3.27%
===========================================
Files 96 38 -58
Lines 5399 2079 -3320
===========================================
- Hits 5191 1931 -3260
+ Misses 208 148 -60
Impacted Files | Coverage Δ | |
---|---|---|
app/api/dao/mentorship_relation.py | 95.65% <75.00%> (-0.46%) |
:arrow_down: |
app/messages.py | 100.00% <100.00%> (ø) |
|
app/api/resources/mentorship_relation.py | 96.51% <0.00%> (-1.24%) |
:arrow_down: |
app/api/dao/user.py | 85.82% <0.00%> (-0.06%) |
:arrow_down: |
app/api/models/user.py | 100.00% <0.00%> (ø) |
|
app/api/api_extension.py | 100.00% <0.00%> (ø) |
|
app/api/jwt_extension.py | 100.00% <0.00%> (ø) |
|
app/api/models/mentorship_relation.py | 100.00% <0.00%> (ø) |
|
app/schedulers/delete_unverified_users_cron_job.py | 100.00% <0.00%> (ø) |
|
... and 73 more |
@vj-codes Please have a look
Please add releavant tests as well
@decon-harsh any updates here?
@decon-harsh any updates?