From 9a23c142e8eeea63e68f8cafc92e526a39016fa0 Mon Sep 17 00:00:00 2001 From: James Tauber Date: Wed, 1 Aug 2012 23:02:53 -0400 Subject: [PATCH] tweaked available teams tag to avoid overlap --- symposion/teams/templatetags/teams_tags.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/symposion/teams/templatetags/teams_tags.py b/symposion/teams/templatetags/teams_tags.py index 62005a3c..a50ca93a 100644 --- a/symposion/teams/templatetags/teams_tags.py +++ b/symposion/teams/templatetags/teams_tags.py @@ -23,15 +23,10 @@ class AvailableTeamsNode(template.Node): 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""