tweaked available teams tag to avoid overlap
This commit is contained in:
parent
1bfd0cc2f0
commit
9a23c142e8
1 changed files with 4 additions and 9 deletions
|
@ -23,15 +23,10 @@ class AvailableTeamsNode(template.Node):
|
||||||
teams = []
|
teams = []
|
||||||
for team in Team.objects.all():
|
for team in Team.objects.all():
|
||||||
state = team.get_state_for_user(request.user)
|
state = team.get_state_for_user(request.user)
|
||||||
if team.access == "open":
|
|
||||||
if state in [None, "invited"]:
|
|
||||||
teams.append(team)
|
|
||||||
elif team.access == "application":
|
|
||||||
if state in [None, "invited", "applied"]:
|
|
||||||
teams.append(team)
|
|
||||||
elif team.access == "invitation":
|
|
||||||
if state == "invited":
|
if state == "invited":
|
||||||
teams.append(team)
|
teams.append(team)
|
||||||
|
elif team.access == "open" and state is None:
|
||||||
|
teams.append(team)
|
||||||
context[self.context_var] = teams
|
context[self.context_var] = teams
|
||||||
return u""
|
return u""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue