Skip to content

Conversation

@lytes20
Copy link
Contributor

@lytes20 lytes20 commented Aug 9, 2018

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

screen shot 2018-08-09 at 11 14 36

@lytes20 lytes20 force-pushed the ft-users-create-profiles-159082378 branch 3 times, most recently from 56b4cd2 to 3f4836a Compare August 9, 2018 09:40
@coveralls
Copy link

coveralls commented Aug 9, 2018

Coverage Status

Coverage increased (+0.5%) to 91.578% when pulling 938949e on ft-users-create-profiles-159082378 into 7d26530 on develop.

# 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',)
Copy link
Contributor

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?

Copy link
Contributor Author

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',)
Copy link
Contributor

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?

Copy link
Contributor Author

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)

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great

Copy link
Contributor

@ssewilliam ssewilliam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@geofrocker geofrocker merged commit dd42865 into develop Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants