Changeset - 3998fe3369f8
[Not reviewed]
0 3 0
James Tauber - 12 years ago 2012-08-02 01:59:23
jtauber@jtauber.com
properly link to and control access to team detail page
3 files changed with 6 insertions and 5 deletions:
0 comments (0 inline, 0 general)
symposion/teams/urls.py
Show inline comments
...
 
@@ -2,5 +2,5 @@ from django.conf.urls.defaults import *
 

	
 

	
 
urlpatterns = patterns("symposion.teams.views",
 
    url(r"^(\w+)/$", "team_detail", name="team_detail"),
 
    url(r"^([\w\-]+)/$", "team_detail", name="team_detail"),
 
)
symposion/teams/views.py
Show inline comments
...
 
@@ -9,7 +9,7 @@ from symposion.teams.models import Team
 
@login_required
 
def team_detail(request, slug):
 
    team = get_object_or_404(Team, slug=slug)
 
    if team.get_state_for_user(request.user) != "manager":
 
    if team.access == "invitation" and team.get_state_for_user(request.user) is None:
 
        raise Http404()
 
    
 
    return render(request, "teams/team_detail.html", {
symposion_project/templates/dashboard.html
Show inline comments
...
 
@@ -148,11 +148,12 @@
 
            {% available_teams as available_teams %}
 
            {% if available_teams %}
 
                <h4>Available Teams</h4>
 
                <ul>
 
                <dl>
 
                    {% for team in available_teams %}
 
                        <li>{{ team }} <span class="label">{{ team.get_access_display }}</span></li>
 
                        <dt><a href="{% url team_detail team.slug %}">{{ team }}</a> <span class="label">{{ team.get_access_display }}</span></dt>
 
                        {% if team.description %}<dd>{{ team.description }}</dd>{% endif %}
 
                    {% endfor %}
 
                </ul>
 
                </dl>
 
            {% endif %}
 
        </div>
 
    </div>
0 comments (0 inline, 0 general)