mentorship-backend
mentorship-backend copied to clipboard
Add to List Users API the ability to filter users by location
Description
As a member of the app, I need be able to filter other members by their location, so that I can choose the member I want to create a mentorship relation with.
APIs used to fetch Users, don't have an option to filter users by location
attribute.
Note: This issue is labeled for Open Source Hack.
I can assign this issue to you on September 1st as the official opening date for Open Source Hack. Please free to check out other issues in the meantime. Program website: https://anitab-org.github.io/events/open-source-hack/
Acceptance Criteria
Update [Required]
- [ ] Add a query parameter support to
GET /users
andGET /users/verified
, to filter users bylocation
attribute. - [ ] Update Swagger UI documentation for this API.
- [ ] Write at least one test to prove your new feature is working.
Definition of Done
- [ ] All of the required items are completed.
- [ ] Approval by 1 mentor.
Estimation
[4] hours
Hi,
I want to work on this one. please assign it to me.
@Ashokrayal I have assigned you. I hope you have set up the environment and read community guidelines.
Happy Coding. :smiley:
Thanks :) I will work on this on this Saturday. I can work on two issues over weekend, if assigned.
@Ashokrayal We need to make it fair for everyone and can't give more than 1 atm. So that everyone gets a chance. You can always work on more. Additionally, remember:
Contributing guidelines After approval you must make continuous notes on your progress in the issue while working. If there is not at least one comment every 3 days, the maintainer can reassign the issue.
@Ashokrayal how's the PR going?
Hi. I had issues in setup. Now it looks good. Will work on it in the evening. Thanks
Hi @paritoshsinghrahar, @vj-codes
Issue is resolved. Need to add one test case but 40 testcases are failing.
All have similar error -
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: users.email [SQL: 'INSERT INTO users (name, username, email, password_hash, registration_date, terms_and_conditions_checked, is_admin, is_email_verified, email_verification_date, current_mentorship_role, membership_status, bio, location, occupation, organization, slack_username, social_media_links, skills, interests, resume_url, photo_url, need_mentoring, available_to_mentor) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: ('Admin', 'admin_username', '[email protected]', 'pbkdf2:sha256:50000$kfp8Z0Hu$72615dd331fe905cf2cf24f2ab9afa72bb2914d6dbef95218e86ea462ccb059c', 1599496969.716998, 1, 0, 0, None, None, None, None, None, None, None, None, None, None, None, None, None, 0, 0)] (Background on this error at: http://sqlalche.me/e/gkpj)
@Ashokrayal Can you describe the errors in more detail? Also, like what kind of changes you made to reach, here. First, make a PR, we can then resolve the test cases there. Where I'll be able to see changes in code.
thanks @paritoshsinghrahar 👍
I got it all sorted out. I am checking the location using contains. So It will work like below.
location=delhi
results
- delhi
- new delhi
- xyzdelhi
- delhiabc
Oh okay. Your PR will be reviewed. You can move on to other issues. @Ashokrayal
Hi, Is this issue resolved or still available?
no @vermastuti it's not. PR is under review :)
Hi @paritoshsinghrahar , @vj-codes, Can someone review this PR?
@paritoshsinghrahar @isabelcosta @vj-codes @SanketDG Is this active and available for work?
Putting on hold as the best approach is not decided yet