Skip to content

Commit

Permalink
tweaked available teams tag to avoid overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Aug 2, 2012
1 parent 1bfd0cc commit 9a23c14
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions symposion/teams/templatetags/teams_tags.py
Expand Up @@ -23,15 +23,10 @@ def render(self, context):
teams = []
for team in Team.objects.all():
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":
teams.append(team)
if state == "invited":
teams.append(team)
elif team.access == "open" and state is None:
teams.append(team)
context[self.context_var] = teams
return u""

Expand Down

0 comments on commit 9a23c14

Please sign in to comment.