-
Notifications
You must be signed in to change notification settings - Fork 447
Fix: Multiple relation requests from a user to same member #994
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
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report
@@ 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
|
8b57bed
to
2227b48
Compare
@vj-codes Please have a look |
Please add releavant tests as well |
@decon-harsh any updates here? |
@decon-harsh any updates? |
return messages.MENTOR_ALREADY_IN_A_RELATION, HTTPStatus.BAD_REQUEST | ||
elif ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you don't really need elif over here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand why isn't it required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just use another if statement right ? No need for the elif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean I can but why, if the relation.state is ACCEPTED it cannot be PENDING then , only one prevails at a time. Do you still want me to use if instead of elif?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with what @decon-harsh says here. @epicadk why we need an if here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing due to inactivity, thank you for your contribution:)
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/Quality Assurance Only
How Has This Been Tested?
Manually through postman

Ran all tests
Mocks
Checklist:
Code/Quality Assurance Only