Skip to content

Commit

Permalink
Silence pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisRayM committed Apr 30, 2020
1 parent 7e964c1 commit 949a9a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions onadata/apps/api/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def get_organization_members_team(organization):
return team


# pylint: disable=invalid-name
def get_or_create_organization_owners_team(org):
"""
Get the owners team of an organization
Expand All @@ -192,16 +193,15 @@ def get_or_create_organization_owners_team(org):
team_name = f'{org.user.username}#{Team.OWNER_TEAM_NAME}'
try:
team = Team.objects.get(name=team_name, organization=org.user)
return team
except Team.DoesNotExist:
from multidb.pinning import use_master # pylint: disable=import-error
with use_master:
queryset = Team.objects.filter(
name=team_name, organization=org.user)
if queryset.count() > 0:
return queryset.first()
else:
return create_owner_team_and_assign_permissions(org)
return queryset.first() # pylint: disable=no-member
return create_owner_team_and_assign_permissions(org)
return team


def remove_user_from_organization(organization, user):
Expand Down

0 comments on commit 949a9a0

Please sign in to comment.