From b4bec2776db5eb10eb9d436686c6bd71e205445c Mon Sep 17 00:00:00 2001 From: Matt Biddulph Date: Fri, 18 May 2012 13:55:26 +0100 Subject: [PATCH] Add "View weavr Angles config" to admin screen for AccessToken. --- .../templates/admin/webapp/accesstoken/change_form.html | 1 + angles-prosthetic/urls.py | 1 + angles-prosthetic/webapp/admin.py | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/angles-prosthetic/templates/admin/webapp/accesstoken/change_form.html b/angles-prosthetic/templates/admin/webapp/accesstoken/change_form.html index af5e8d3..89c97d5 100644 --- a/angles-prosthetic/templates/admin/webapp/accesstoken/change_form.html +++ b/angles-prosthetic/templates/admin/webapp/accesstoken/change_form.html @@ -9,6 +9,7 @@
  • View weavr blog
  • +
  • View weavr Angles config
  • Call method
  • diff --git a/angles-prosthetic/urls.py b/angles-prosthetic/urls.py index a48815a..81f62c4 100644 --- a/angles-prosthetic/urls.py +++ b/angles-prosthetic/urls.py @@ -44,6 +44,7 @@ (r'^admin/accesstoken_action/(\d+)/$', 'webapp.admin.admin_action'), (r'^admin/accesstoken_blog/(\d+)/$', 'webapp.admin.view_blog'), + (r'^admin/accesstoken_config/(\d+)/$', 'webapp.admin.view_config'), (r'^admin/', include(admin.site.urls)), (r'^login/$', 'django.contrib.auth.views.login'), diff --git a/angles-prosthetic/webapp/admin.py b/angles-prosthetic/webapp/admin.py index 3f80b26..13038b0 100644 --- a/angles-prosthetic/webapp/admin.py +++ b/angles-prosthetic/webapp/admin.py @@ -174,6 +174,10 @@ def admin_action(request, key): return redirect("/admin/webapp/accesstoken/%s/"%key) +def view_config(request, key): + token = get_object_or_404(AccessToken, id=key) + return redirect("/angles/config/%s/" % token.oauth_key) + def view_blog(request, key): token = get_object_or_404(AccessToken, id=key) logging.info(token.blog_filter_url())