def hdlr(request, course_id, *args, **kwargs):
allowed = request.user.is_superuser
if not allowed:
+ course = models.Course.objects.get(pk=course_id)
+ allowed = ((request.user.is_anonymous and course.access=='ANON') or \
+ (request.user.is_authenticated and course.access=='LOGIN'))
+ if not allowed:
allowed = _fast_user_membership_query(request.user.id, course_id)
if allowed:
return handler(request, course_id, *args, **kwargs)
<body>
<h1>${title}</h1>
<ul>
+ <li><a href="/admin/">Django Administrative UI</a></li>
+ </ul>
+
+ <ul>
<li><a href="checkout/">Charge/Discharge</a></li>
</ul>
<ul>
<a href="${item.item_url()}">${item}</a>
<span class="menublock">
<span py:if="item.needs_meta_link()">
- <a href="${item.item_url('meta')}">about</a> •</span>
- <a href="${item.item_url('edit/')}">edit</a>
+ <a href="${item.item_url('meta')}">about</a> </span>
+ <span py:if="edit">
+ • <a href="${item.item_url('edit/')}">edit</a>
+ </span>
</span>
<!-- !to show a full tree, uncomment the following: -->
<!-- ${show_tree(subs, edit)} -->
<a href="/accounts/logout">Log Out</a>
• <a href="/syrup/setlang">Language</a>
• <a href="/syrup/prefs/">Preferences</a>
- • <a href="/admin/">Admin UI</a>
</span>
<span py:if="not user.is_authenticated()">
<strong style="padding-right: 18;">Welcome!</strong>