Mentorship-backend: endpoint /mentorship_relation/send_request does not validate users id

Created on 16 Feb 2020  路  5Comments  路  Source: anitab-org/mentorship-backend

Describe the bug
When mentor_id to mentee_id is invalid Internal server error occurs (500)

To Reproduce
Steps to reproduce the behaviour:

  1. Go to localhost try out'/mentorship_relation/send_request.'
  2. Send mentorship relation request with non existing "mentor_id": 0, or "mentee_id": 0.
  3. See internal server error

Expected behavior
Backend should return bad request with information that user with specific id does not exists

Additional context
AttributeError: 'tuple' object has no attribute 'name'

Coding Bug

All 5 comments

@isabelcosta Can i try this one?

Go ahead :) @srivastava9

@isabelcosta could you please review the pr :)

@isabelcosta I have again tested as you said could you review the pr once again. Thanks :)

I think this issue was fixed in pr #489 (as mentioned in #456).

Was this page helpful?
0 / 5 - 0 ratings