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

Update friendships.py #438

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update friendships.py #438

wants to merge 4 commits into from

Conversation

tonk0112
Copy link

What does this PR do?

(Briefly describe what this PR is about.)

Why was this PR needed?

(Briefly describe reasons.)

What are the relevant issue numbers?

(List issue numbers here.)

Does this PR meet the acceptance criteria?

  • Passes flake8 (refer to .travis.yml)
  • Docs are buildable
  • Branch has no merge conflicts with master
  • Is covered by a test

class FriendshipsEndpointsMixin(object):
"""For endpoints in ``/friendships/``."""

def duje_cc(self):
Copy link
Author

Choose a reason for hiding this comment

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

b

@@ -17,12 +14,10 @@ def duje_cc(self):
[ClientCompatPatch.list_user(user, drop_incompat_keys=self.drop_incompat_keys)
for user in res['users']]
return res

def duje_cc(self, user_id, rank_token, **kwargs):
Copy link
Author

Choose a reason for hiding this comment

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

b

"""
Get user followings

:param user_id:
Copy link
Author

Choose a reason for hiding this comment

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

b

@@ -31,23 +26,19 @@ def duje_cc(self, user_id, rank_token, **kwargs):
:return:
"""
raise_if_invalid_rank_token(rank_token)

endpoint = 'friendships/{user_id!s}/following/'.format(**{'user_id': user_id})
Copy link
Author

Choose a reason for hiding this comment

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

b

query_params = {
'rank_token': rank_token,
}
Copy link
Author

Choose a reason for hiding this comment

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

b

query_params.update(kwargs)
res = self._call_api(endpoint, query=query_params)
if self.auto_patch:
[ClientCompatPatch.list_user(u, drop_incompat_keys=self.drop_incompat_keys)
for u in res.get('users', [])]
return res

def duje_cc(self, user_id, rank_token, **kwargs):
Copy link
Author

Choose a reason for hiding this comment

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

b

"""
Get user followers

:param duje_cc:
Copy link
Author

Choose a reason for hiding this comment

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

b

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.

1 participant