From 4a70c7bb1f43bb2be9e38d195b73545115fa1ecb Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Mon, 17 Nov 2008 23:51:09 +0000 Subject: [PATCH] Thanks to Paul Boehm, this patch changes Admin links to use a settings-driven URI rather than assuming /admin/. Resolves issue #22 --- templates/helpdesk/system_settings.html | 12 ++++++------ urls.py | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/templates/helpdesk/system_settings.html b/templates/helpdesk/system_settings.html index ea7d7a1a..44d52f74 100644 --- a/templates/helpdesk/system_settings.html +++ b/templates/helpdesk/system_settings.html @@ -9,11 +9,11 @@ {% endblock %} diff --git a/urls.py b/urls.py index 10f862b4..8ee7ae3a 100644 --- a/urls.py +++ b/urls.py @@ -7,6 +7,7 @@ urls.py - Mapping of URL's to our various views. Note we always used NAMED views for simplicity in linking later on. """ +from django.conf import settings from django.conf.urls.defaults import * from django.contrib.auth.decorators import login_required from django.contrib.syndication.views import feed as django_feed @@ -144,6 +145,11 @@ urlpatterns += patterns('', url(r'^system_settings/$', 'django.views.generic.simple.direct_to_template', - {'template': 'helpdesk/system_settings.html',}, + { + 'template': 'helpdesk/system_settings.html', + 'extra_context': { + 'ADMIN_URL': getattr(settings, 'ADMIN_URL', '/admin/'), + }, + }, name='helpdesk_system_settings'), )