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

#161967018 Set up the Follower relationships systems #14

Merged
merged 1 commit into from
Dec 7, 2018

Conversation

babbageLabs
Copy link
Contributor

@babbageLabs babbageLabs commented Dec 6, 2018

What does this PR do?

It implements the follower system

Description of Task to be completed?

Endpoints for following, unfollowing, listing followers and followed users are implemented
POST /api/profile/<str:username>/follow
DELETE /api/profile/<str:username>/follow
GET /api/profile/followers/
GET /api/profile/followed/

How should this be manually tested?

  1. git clone https://github.com/andela/ah-jumanji.git
  2. cd ah-jumanji
  3. git checkout ft-implement-follower-system-161967018
  4. Setup a virtual environment and activate it
  5. pip install -r requirements.txt
  6. python manage.py makemigrations
  7. python manage.py migrate
  8. python manage.py runserver
  9. pytest -v -k "TestFollowerSystem"

What are the relevant pivotal tracker stories?

#161967018

Screenshots (if appropriate)

  1. List all followers

image

  1. List all followed

image

  1. Follow a user

image

  1. Follow an already followed user

image

  1. unfollow a user

image

  1. unfollow a who one does not follow

image

  1. View a user profile with the following status

image

Checklist:

  • My code follows the style guidelines of this project
  • At least 2 people have reviewed my PR
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My PR has one commit.

@babbageLabs babbageLabs added the work-in-progress For PR's that are as yet being worked on label Dec 6, 2018
conftest.py Outdated Show resolved Hide resolved
authors/urls.py Outdated Show resolved Hide resolved
authors/apps/profiles/views.py Outdated Show resolved Hide resolved
authors/apps/profiles/views.py Outdated Show resolved Hide resolved
authors/apps/profiles/views.py Outdated Show resolved Hide resolved
authors/apps/profiles/tests/test_follower_system.py Outdated Show resolved Hide resolved
authors/apps/profiles/tests/test_follower_system.py Outdated Show resolved Hide resolved
authors/apps/profiles/tests/test_follower_system.py Outdated Show resolved Hide resolved
authors/apps/profiles/tests/test_follower_system.py Outdated Show resolved Hide resolved
@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from fae99cb to 4d75bce Compare December 6, 2018 09:28
authors/apps/profiles/tests/test_follower_system.py Outdated Show resolved Hide resolved
authors/apps/profiles/tests/test_follower_system.py Outdated Show resolved Hide resolved
authors/apps/profiles/tests/test_follower_system.py Outdated Show resolved Hide resolved
authors/apps/profiles/tests/test_follower_system.py Outdated Show resolved Hide resolved
authors/apps/profiles/models.py Outdated Show resolved Hide resolved
authors/apps/profiles/models.py Outdated Show resolved Hide resolved
authors/apps/profiles/models.py Outdated Show resolved Hide resolved
authors/apps/profiles/models.py Outdated Show resolved Hide resolved
authors/apps/profiles/models.py Outdated Show resolved Hide resolved
@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from 4d75bce to 9ad060a Compare December 6, 2018 09:45
authors/apps/core/models.py Outdated Show resolved Hide resolved
authors/apps/core/models.py Outdated Show resolved Hide resolved
authors/apps/core/models.py Outdated Show resolved Hide resolved
authors/apps/core/models.py Outdated Show resolved Hide resolved
@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch 3 times, most recently from 971894b to b2c1927 Compare December 6, 2018 10:27
@babbageLabs babbageLabs changed the title [WIP]#161967018 Set up following relationships #161967018 Set up following relationships Dec 6, 2018
@babbageLabs babbageLabs removed the work-in-progress For PR's that are as yet being worked on label Dec 6, 2018
@babbageLabs babbageLabs changed the title #161967018 Set up following relationships #161967018 Set up the Follower relationships systems Dec 6, 2018
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

The API Spec specifies that the follow/unfollow relationship be handled at a single endpoint, that accepts POST and DELETE requests to follow\unfollow respectively.
Please amend your implementation to reflect this.

@ghost ghost added the changes-requested For PR's that need changes label Dec 6, 2018
@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from b2c1927 to 0426eff Compare December 6, 2018 15:38
@ghost ghost removed the changes-requested For PR's that need changes label Dec 6, 2018
@fabzer0
Copy link
Contributor

fabzer0 commented Dec 6, 2018

This PR looks Okay

Copy link
Contributor

@mashafrancis mashafrancis left a comment

Choose a reason for hiding this comment

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

Awesome work.

@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from 0acb0da to 091941b Compare December 6, 2018 18:35
@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from 091941b to a1a2837 Compare December 6, 2018 18:46
@gwako94
Copy link
Contributor

gwako94 commented Dec 6, 2018

Looks good to merge.

@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from f986119 to e0ca448 Compare December 7, 2018 07:13
@ghost ghost added the approved For PR's that have been reviewed and approved by >=3 peers label Dec 7, 2018
@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from e0ca448 to 331b142 Compare December 7, 2018 13:30

class Meta:
model = Profile
exclude = ('username','email',)

Choose a reason for hiding this comment

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

missing whitespace after ','

from rest_framework import serializers

from authors.apps.authentication.serializers import UserSerializer
from authors.apps.profiles.models import Profile, Following

Choose a reason for hiding this comment

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

redefinition of unused 'Profile' from line 2

@@ -1,8 +1,76 @@
from rest_framework import serializers
from .models import Profile
import logging

from rest_framework import serializers

Choose a reason for hiding this comment

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

redefinition of unused 'serializers' from line 1

@@ -4,3 +4,4 @@
from .models import Profile

admin.site.register(Profile)

Choose a reason for hiding this comment

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

blank line at end of file

@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from 331b142 to 8de8890 Compare December 7, 2018 13:35
- Add models for profile and following
- Add factory-b0y factories for the models
- Move conftest.py to root directory to allow for collection of fixtures
  before tests run
- write unit tests
- update backends.py to facilitate JWT authentication
- add views for following, unfollowing
- add views for viewing folowers and followed
- add view for viewing a user profile and the following status
- remove unused imports
- fix hound styling violations
- fix merge conflicts with develop

[Finishes #161967018]

feat(reset password) Impelements password reset  …
  - send a password reset email
  - update user password
[finishes #161967011]

feat(validation-errors): Add descriptive validation errors
- write unit tests for the errors
- implement the error messages on the register api
[Finishes #161967009]
@babbageLabs babbageLabs force-pushed the ft-implement-follower-system-161967018 branch from 8de8890 to af47cd6 Compare December 7, 2018 13:39
@mirr254 mirr254 merged commit 1cbad8f into develop Dec 7, 2018
@ghost ghost deleted the ft-implement-follower-system-161967018 branch December 17, 2018 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved For PR's that have been reviewed and approved by >=3 peers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants