Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add link to professor overview from page page

There is no better way of saying it

Also fixed some other bugs, etc
  • Loading branch information...
commit 1dd513346102e35f5e408c7ff3df5ea35478d25e 1 parent 5bc883c
@dellsystem authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  templates/pages/show.html
  2. +1 −1  urls.py
  3. +1 −1  views/courses.py
View
2  templates/pages/show.html
@@ -19,7 +19,7 @@
{% if metadata %}
<ul class="unstyled">
{% for field, content in metadata.iteritems %}
- <li><strong>{{ field.title }}</strong>: {% if content %}{{ content|urlize }}{% endif %}</li>
+ <li><strong>{{ field.title }}</strong>: {% if content %}{% if content.get_absolute_url %}<a href="{{ content.get_absolute_url }}">{{ content }}</a>{% else %}{{ content|urlize }}{% endif %}{% endif %}</li>
{% endfor %}
</ul>
{% else %}
View
2  urls.py
@@ -15,7 +15,7 @@
slug = '(?P<slug>[^/]+)'
page = course + '/' + page_type + '/' + semester + '/' + slug
sha = '(?P<hash>[a-z0-9]{1,40})'
-professor = '(?P<professor>[a-z-]+)'
+professor = '(?P<professor>[a-z-]*)'
"""
Begin mappings (URLs should be defined in order of descending priority (so highest priority first))
View
2  views/courses.py
@@ -271,7 +271,7 @@ def category(request, department, number, page_type):
def professor_overview(request, professor):
- professor = Professor.objects.get(slug=professor)
+ professor = get_object_or_404(Professor, slug=professor)
context = {
'professor': professor,
Please sign in to comment.
Something went wrong with that request. Please try again.