Completed
Push — master ( bfd75d...9200b0 )
by Manas
01:53
created

AddTeamMembershipAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %
Metric Value
dl 0
loc 8
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 7 1
1
from lib.base import BaseGithubAction
2
from lib.formatters import user_to_dict
3
4
__all__ = [
5
    'AddTeamMembershipAction'
6
]
7
8
9
class AddTeamMembershipAction(BaseGithubAction):
10
    def run(self, organization, team_id, user):
11
        user = self._client.get_user(user)
12
        organization = self._client.get_organization(organization)
13
        team = organization.get_team(team_id)
14
        team.add_membership(member=user)
15
        result = user_to_dict(user=user)
16
        return result
17