Skip to content
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

#165890222 following and unfollowing users #36

Merged
merged 1 commit into from
May 13, 2019

Conversation

joelmugaya
Copy link
Contributor

@joelmugaya joelmugaya commented May 10, 2019

What does the PR do?

  • Allows the user to follow, unfollow and list followers and users he follows.

Description of Task to be completed?

  • Given a user is logged in, he can follow another user
  • He can view users he follows or that another user follows
  • He can view users that follow him or that follow another user

Tasks to be completed

  • update profile model to include following functionality
  • update profile serializer to add a following field to the profile serialized data
  • write tests for the following functionality
  • add endpoints for the follow functionality to the url.py file
  • write functions to handle the follow functionality

How should this be manually tested?

  • to follow a user POST /api/profiles/<username>/follow/ returns "You are following username."
  • on getting the profile GET /api/users/profile/<username>/ returns following: True
  • to unfollow a user DELETE /api/profiles/<username>/follow/
  • to get users followers GET /api/profiles/<username>/followers/
  • to get users following a user GET /api/profiles/<username>/following/

[finishes #165890222]

@joelmugaya joelmugaya added the wip label May 10, 2019
@joelmugaya joelmugaya changed the title feat(follow users) follow and unfollow users #165890222 following and unfollowing users May 10, 2019
@joelmugaya joelmugaya force-pushed the ft-users-able-follow-other-users-165890222 branch 2 times, most recently from 300b62e to d39817f Compare May 10, 2019 07:09
@joelmugaya joelmugaya temporarily deployed to inviticus-staging-pr-36 May 10, 2019 07:15 Inactive
@joelmugaya joelmugaya force-pushed the ft-users-able-follow-other-users-165890222 branch from d39817f to cac131f Compare May 10, 2019 08:45
@joelmugaya joelmugaya temporarily deployed to inviticus-staging-pr-36 May 10, 2019 08:46 Inactive
Copy link
Contributor

@engjames engjames left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@3Nakajugo 3Nakajugo left a comment

Choose a reason for hiding this comment

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

tested the pull request on Heroku and it works

Copy link
Contributor

@mwinel mwinel left a comment

Choose a reason for hiding this comment

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

LGTM.

profile = UserProfile.objects.get(user=value.follower)
profile = FetchUserProfileSerializer(profile)
profiles.append(profile.data)
return Response(profiles, status=status.HTTP_200_OK,)

Choose a reason for hiding this comment

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

@joelmugaya We should return a message You have no followers when the list being returned empty.

profile = UserProfile.objects.get(user=value.followed)
profile = FetchUserProfileSerializer(profile)
profiles.append(profile.data)
return Response(profiles, status=status.HTTP_200_OK,)

Choose a reason for hiding this comment

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

@joelmugaya We should return a message You are following anyone. when the list being returned empty.

@joelmugaya joelmugaya force-pushed the ft-users-able-follow-other-users-165890222 branch from cac131f to 9daafe3 Compare May 10, 2019 15:07
@joelmugaya joelmugaya temporarily deployed to inviticus-staging-pr-36 May 10, 2019 15:07 Inactive
@joelmugaya joelmugaya force-pushed the ft-users-able-follow-other-users-165890222 branch from 9daafe3 to d05d3f2 Compare May 10, 2019 15:11
@joelmugaya joelmugaya temporarily deployed to inviticus-staging-pr-36 May 10, 2019 15:12 Inactive
@joelmugaya joelmugaya force-pushed the ft-users-able-follow-other-users-165890222 branch from d05d3f2 to a948a6d Compare May 13, 2019 07:07
@joelmugaya joelmugaya temporarily deployed to inviticus-staging-pr-36 May 13, 2019 07:07 Inactive
@joelmugaya joelmugaya force-pushed the ft-users-able-follow-other-users-165890222 branch from a948a6d to eabd9da Compare May 13, 2019 07:57
@joelmugaya joelmugaya temporarily deployed to inviticus-staging-pr-36 May 13, 2019 07:57 Inactive
- update profile model to include following functionality
- update profile serializer to add a following field to the profile serialized data
- write tests for the following functionality
- add endpoints for the follow functionality to the url.py file
- write functions to handle the follow functionlity

[finishes #165890222]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants