-
Notifications
You must be signed in to change notification settings - Fork 7
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
#162163267 create view and edit user profile #14
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add all the initial files required for the profile application [Delivers #162163267]
This adds routes to connect the profile app. Define model for Profile and a relationship to User. Create view to retrive profile [Delivers #162163267]
This commit adds a ProfileJSONRenderer class to renderers.py file. The class when added to renderer_classes in the views formarts the returned profile and lets the default renderer handle exceptions raised [Delivers #162163267]
This commit adds a signal that is run when the user is created the first time and. This signal the creation of a profile for that user. [Delivers #162163267]
This commit adds a signal that is run when the user is created the first time and. This signal the creation of a profile for that user. [Delivers #162163267]
This commit adds signals file with the create profile function [Delivers #162163267]
This commit adds an update function to the ProfileRetrieveView [Delivers #162163267]
This commit adds authentication to the profile endpoints. This makes them requie jwt token to be accessed [Delivers #162163267]
This commit adds tests for getting a profile of an existing user [Delivers #162163267]
Kasulejoseph
approved these changes
Dec 7, 2018
joshtrigger
approved these changes
Dec 7, 2018
collin5
suggested changes
Dec 7, 2018
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.
Have you fixed issues with edit bio
and profile_pic
? Also add tests for this.
This commit adds edit image and bio functionality when a user sends a post request [Delivers #162163267]
Add all the initial files required for the profile application [Delivers #162163267]
This adds routes to connect the profile app. Define model for Profile and a relationship to User. Create view to retrive profile [Delivers #162163267]
This commit adds a ProfileJSONRenderer class to renderers.py file. The class when added to renderer_classes in the views formarts the returned profile and lets the default renderer handle exceptions raised [Delivers #162163267]
This commit adds a signal that is run when the user is created the first time and. This signal the creation of a profile for that user. [Delivers #162163267]
This commit adds an update function to the ProfileRetrieveView [Delivers #162163267]
This commit adds authentication to the profile endpoints. This makes them requie jwt token to be accessed [Delivers #162163267]
This commit adds tests for getting a profile of an existing user [Delivers #162163267]
This commit adds edit image and bio functionality when a user sends a post request [Delivers #162163267]
This commit adds a functionality to edit bio and image when user sends PUT request to /api/user/ [Delivers #162163267]
This commit adds test for update bio and image [Delivers #162163267]
This commit adds a check if the profile one is trying to get exists. Adds ProfileDoesNotExist class to raise exception if it does not exist. It also removes update function from ProfileRetrieveView because it was not being used anywhere. Also adds test for this check [Delivers #162163267]
I have fixed the issues with edit bio and image and added the tests |
collin5
approved these changes
Dec 10, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what does this PR do?
Adds create view and edit of user profile
Description of tasks to be completed
writing unit tests for this feature
Have these endpoints working
POST /api/user
PUT /api/user
GET /api/profiles/:username
How this can be tested manually
Clone the repo,
Install the requirements with pip install -r requirements.txt
To run tests, run ./manage.py test
Run python manage.py runserver
Test the endpoints in postman
Profile creation
Profile is created when user signs up
To test this
Send post request to http://127.0.0.1:8000/api/users/
with body
Then login that user by sending a POST request to http://127.0.0.1:8000/api/users/login/
Login data format --> POST /api/users/login/
with body
get the token returned
then send a GET request to http://127.0.0.1:8000/api/profiles/soko
![image](https://user-images.githubusercontent.com/10868919/49646246-9c732980-fa2f-11e8-852f-0d7ba487a1ce.png)
Test update profile
Send a PUT request to http://127.0.0.1:8000/api/user/
with body and authentication token