-
Notifications
You must be signed in to change notification settings - Fork 3
#159082378 Users should be able to create their profiles #24
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
Conversation
56b4cd2 to
3f4836a
Compare
3f4836a to
938949e
Compare
| # password field, we needed to specify the `min_length` and | ||
| # `max_length` properties too, but that isn't the case for the token | ||
| # field. | ||
| read_only_fields = ('token',) |
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.
why did you remove this?
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.
This was no longer needed code, it use was that it was necessary when displaying the token along with user information
|
|
||
| class Meta: | ||
| model = User | ||
| fields = ('email', 'username', 'password', 'token',) |
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.
why did you remove this?
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.
Same thing here, I didn't delete the entire line but rather deleted the token field and modified it to add other user profile fields. these fields are later displayed as user's information/profile.
|
|
||
| # A timestamp representing when this object was created. | ||
| created_at = models.DateTimeField(auto_now_add=True) | ||
|
|
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.
why did you remove these fields
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.
The created_at and updated_at fields are shared by both the User model and Profile model. so i deleted them from the user model. Added them to a model file that can be shared by both apps as a user and a profile are created and updated at same times.
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.
great
ssewilliam
left a comment
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.
This looks good
What does this PR do?
Creates a profile for user when a user registers
Description of Task to be completed?
Once a user is registered, their profile is created
The profile displays the bio, image/avatar, and username.
A user can view their profiles, edit it but can NOT edit another user's profile.
How should this be manually tested?
By creating a user and then retrieving their profile at this endpoint
profiles/<username>/Any background context you want to provide?
profiles are very helpful for displaying user information
What are the relevant pivotal tracker stories?
#159082378
Screenshots