Changeset - e96e416bdce9
[Not reviewed]
0 1 0
James Tauber - 12 years ago 2012-08-02 14:46:37
jtauber@jtauber.com
fixed polarity problem in is_staff check
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
symposion/teams/views.py
Show inline comments
...
 
@@ -47,9 +47,9 @@ def can_apply(team, user):
 
@login_required
 
def team_detail(request, slug):
 
    team = get_object_or_404(Team, slug=slug)
 
    state = team.get_state_for_user(request.user)
 
    if team.access == "invitation" and state is None and request.user.is_staff:
 
    if team.access == "invitation" and state is None and not request.user.is_staff:
 
        raise Http404()
 
    
 
    return render(request, "teams/team_detail.html", {
 
        "team": team,
...
 
@@ -63,9 +63,9 @@ def team_detail(request, slug):
 
@login_required
 
def team_join(request, slug):
 
    team = get_object_or_404(Team, slug=slug)
 
    state = team.get_state_for_user(request.user)
 
    if team.access == "invitation" and state is None and request.user.is_staff:
 
    if team.access == "invitation" and state is None and not request.user.is_staff:
 
        raise Http404()
 
    
 
    if can_join(team, request.user) and request.method == "POST":
 
        membership, created = Membership.objects.get_or_create(team=team, user=request.user)
...
 
@@ -80,9 +80,9 @@ def team_join(request, slug):
 
@login_required
 
def team_leave(request, slug):
 
    team = get_object_or_404(Team, slug=slug)
 
    state = team.get_state_for_user(request.user)
 
    if team.access == "invitation" and state is None and request.user.is_staff:
 
    if team.access == "invitation" and state is None and not request.user.is_staff:
 
        raise Http404()
 
    
 
    if can_leave(team, request.user) and request.method == "POST":
 
        membership = Membership.objects.get(team=team, user=request.user)
...
 
@@ -96,9 +96,9 @@ def team_leave(request, slug):
 
@login_required
 
def team_apply(request, slug):
 
    team = get_object_or_404(Team, slug=slug)
 
    state = team.get_state_for_user(request.user)
 
    if team.access == "invitation" and state is None and request.user.is_staff:
 
    if team.access == "invitation" and state is None and not request.user.is_staff:
 
        raise Http404()
 
    
 
    if can_apply(team, request.user) and request.method == "POST":
 
        membership, created = Membership.objects.get_or_create(team=team, user=request.user)
0 comments (0 inline, 0 general)