mentorship-backend icon indicating copy to clipboard operation
mentorship-backend copied to clipboard

Fix: Multiple relation requests from a user to same member

Open decon-harsh opened this issue 4 years ago • 5 comments

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 Screenshot from 2021-02-03 22-08-14

Mocks

Screenshot from 2021-02-03 22-09-34

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

decon-harsh avatar Feb 03 '21 16:02 decon-harsh

Codecov Report

Merging #994 (01393c4) into develop (8f1906e) will decrease coverage by 3.26%. The diff coverage is 83.33%.

Impacted file tree graph

@@             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

codecov[bot] avatar Feb 03 '21 16:02 codecov[bot]

@vj-codes Please have a look

decon-harsh avatar Feb 03 '21 16:02 decon-harsh

Please add releavant tests as well

epicadk avatar Apr 13 '21 06:04 epicadk

@decon-harsh any updates here?

vj-codes avatar May 05 '21 17:05 vj-codes

@decon-harsh any updates?

vj-codes avatar May 18 '21 15:05 vj-codes