Merge lp:~michael.nelson/ubuntu-webcatalog/fix-admin-template into lp:ubuntu-webcatalog

Proposed by Michael Nelson
Status: Merged
Approved by: Łukasz Czyżykowski
Approved revision: 184
Merged at revision: 183
Proposed branch: lp:~michael.nelson/ubuntu-webcatalog/fix-admin-template
Merge into: lp:ubuntu-webcatalog
Diff against target: 53 lines (+16/-2)
3 files modified
django_project/config/main.cfg (+4/-0)
src/webcatalog/templates/admin/login.html (+2/-2)
src/webcatalog/tests/test_views.py (+10/-0)
To merge this branch: bzr merge lp:~michael.nelson/ubuntu-webcatalog/fix-admin-template
Reviewer Review Type Date Requested Status
Łukasz Czyżykowski (community) Approve
Review via email: mp+161155@code.launchpad.net

Commit message

Update custom admin/login.html so that we're not using a templatetag library no longer available in django 1.5.

Description of the change

The /admin/ url was 500ing on staging after deploy. Turns out it's because we've got an admin/login.html template that uses an admin templatetag library that is no longer available in django 1.5. It wasn't obvious in our dev environment, because this admin template wasn't found (staging/prod has the template_dirs setting, which we didn't have locally, which enables the admin template to be found in the non-admin template dir).

fab test:pg=true

To post a comment you must log in.
Revision history for this message
Łukasz Czyżykowski (lukasz-czyzykowski) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'django_project/config/main.cfg'
--- django_project/config/main.cfg 2013-04-23 07:32:27 +0000
+++ django_project/config/main.cfg 2013-04-26 14:31:27 +0000
@@ -41,6 +41,10 @@
41 django.template.loaders.app_directories.Loader41 django.template.loaders.app_directories.Loader
42 django.template.loaders.eggs.Loader42 django.template.loaders.eggs.Loader
4343
44# This enables the admin app to find webcatalog/templates/admin like the
45# staging/prod configs. Comment out to login normally on the dev server.
46template_dirs = src/webcatalog/templates
47
44secret_key = eepu9Av5ixage9ahhodovahfaiFoorodahf6keip3eichaeW9f48secret_key = eepu9Av5ixage9ahhodovahfaiFoorodahf6keip3eichaeW9f
45template_debug = %(debug)s49template_debug = %(debug)s
46time_zone = Europe/London50time_zone = Europe/London
4751
=== modified file 'src/webcatalog/templates/admin/login.html'
--- src/webcatalog/templates/admin/login.html 2011-08-10 18:58:04 +0000
+++ src/webcatalog/templates/admin/login.html 2013-04-26 14:31:27 +0000
@@ -1,7 +1,7 @@
1{% extends "admin/base_site.html" %}1{% extends "admin/base_site.html" %}
2{% load i18n %}2{% load i18n admin_static %}
33
4{% block extrastyle %}<link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}css/login.css" />{% endblock %}4{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/login.css" %}" />{% endblock %}
55
6{% block bodyclass %}login{% endblock %}6{% block bodyclass %}login{% endblock %}
77
88
=== modified file 'src/webcatalog/tests/test_views.py'
--- src/webcatalog/tests/test_views.py 2013-04-09 13:53:18 +0000
+++ src/webcatalog/tests/test_views.py 2013-04-26 14:31:27 +0000
@@ -43,6 +43,7 @@
4343
44__metaclass__ = type44__metaclass__ = type
45__all__ = [45__all__ = [
46 'AdminLoginTestCase',
46 'ApplicationDetailNoSeriesTestCase',47 'ApplicationDetailNoSeriesTestCase',
47 'ApplicationDetailTestCase',48 'ApplicationDetailTestCase',
48 'ApplicationListTestCase',49 'ApplicationListTestCase',
@@ -1454,3 +1455,12 @@
1454 expected = {"status": "PENDING", "traceback": None, "id": "cafe"}1455 expected = {"status": "PENDING", "traceback": None, "id": "cafe"}
14551456
1456 self.assertEqual(expected, data)1457 self.assertEqual(expected, data)
1458
1459
1460class AdminLoginTestCase(TestCase):
1461
1462 def test_unauthed_admin_renders(self):
1463 response = self.client.get('/admin/')
1464
1465 self.assertEqual(response.status_code, 200)
1466 self.assertContains(response, 'action="/openid/login/"')

Subscribers

People subscribed via source and target branches