some error catching around has-teams and api permissions
This commit is contained in:
@@ -173,10 +173,13 @@ def rdata(file,rower=rrower()):
|
||||
|
||||
# Query to get teams managed and member of
|
||||
def get_my_teams(user):
|
||||
therower = Rower.objects.get(user=user)
|
||||
teams1 = therower.team.all()
|
||||
teams2 = Team.objects.filter(manager=user)
|
||||
teams = list(set(teams1).union(set(teams2)))
|
||||
try:
|
||||
therower = Rower.objects.get(user=user)
|
||||
teams1 = therower.team.all()
|
||||
teams2 = Team.objects.filter(manager=user)
|
||||
teams = list(set(teams1).union(set(teams2)))
|
||||
except TypeError:
|
||||
teams = []
|
||||
|
||||
return teams
|
||||
|
||||
|
||||
Reference in New Issue
Block a user