Changeset - 9a23c142e8ee
[Not reviewed]
0 1 0
James Tauber - 12 years ago 2012-08-02 03:02:53
jtauber@jtauber.com
tweaked available teams tag to avoid overlap
1 file changed with 4 insertions and 9 deletions:
0 comments (0 inline, 0 general)
symposion/teams/templatetags/teams_tags.py
Show inline comments
...
 
@@ -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""
 

	
0 comments (0 inline, 0 general)