Skip to content

Commit

Permalink
properly link to and control access to team detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Aug 2, 2012
1 parent 40f4d1b commit 3998fe3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion symposion/teams/urls.py
Expand Up @@ -2,5 +2,5 @@


urlpatterns = patterns("symposion.teams.views",
url(r"^(\w+)/$", "team_detail", name="team_detail"),
url(r"^([\w\-]+)/$", "team_detail", name="team_detail"),
)
2 changes: 1 addition & 1 deletion symposion/teams/views.py
Expand Up @@ -9,7 +9,7 @@
@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", {
Expand Down
7 changes: 4 additions & 3 deletions symposion_project/templates/dashboard.html
Expand Up @@ -148,11 +148,12 @@ <h4>Your Teams</h4>
{% 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>
Expand Down

0 comments on commit 3998fe3

Please sign in to comment.