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

ListTeamsAction.run()   A

Complexity

Conditions 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 9
rs 9.6666
1
from lib.base import BaseGithubAction
2
from lib.formatters import team_to_dict
3
4
__all__ = [
5
    'ListTeamsAction'
6
]
7
8
9
class ListTeamsAction(BaseGithubAction):
10
    def run(self, organization):
11
        organization = self._client.get_organization(organization)
12
        teams = organization.get_teams()
13
        result = []
14
        for team in teams:
15
            team = team_to_dict(team=team)
16
            result.append(team)
17
18
        return result
19