Skip to content

Commit

Permalink
Add "View weavr Angles config" to admin screen for AccessToken.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattb committed May 18, 2012
1 parent d0f2146 commit b4bec27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<!-- TI local change -->
<li><a href="/admin/accesstoken_blog/{{ object_id }}/" class="viewsitelink">View weavr blog</a></li>
<li><a href="/admin/accesstoken_config/{{ object_id }}/" class="viewsitelink">View weavr Angles config</a></li>
<li><a href="/call/{{ object_id }}/" class="viewsitelink">Call method</a></li>
<!-- TI end local change -->

Expand Down
1 change: 1 addition & 0 deletions angles-prosthetic/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
4 changes: 4 additions & 0 deletions angles-prosthetic/webapp/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit b4bec27

Please sign in to comment.