From 2ed192c539d2c083573242c56572fd99a45b9e24 Mon Sep 17 00:00:00 2001 From: groovecoder Date: Mon, 26 Jan 2015 17:16:11 -0600 Subject: [PATCH] bug 1121918 - code review cleanups --- kuma/authkeys/templates/authkeys/list.html | 4 ++-- kuma/authkeys/views.py | 2 ++ kuma/users/helpers.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kuma/authkeys/templates/authkeys/list.html b/kuma/authkeys/templates/authkeys/list.html index e16eb890158..ecd478bd639 100644 --- a/kuma/authkeys/templates/authkeys/list.html +++ b/kuma/authkeys/templates/authkeys/list.html @@ -32,9 +32,9 @@ {% endif %} {% else %} -

{% trans %} +

{% trans bugzilla_url="https://bugzilla.mozilla.org/enter_bug.cgi?format=__standard__&product=Mozilla Developer Network&component=User management" %} You need a special permission to use API keys. - You may request permission by filing a bug. + You may request permission by filing a bug. {% endtrans %}

diff --git a/kuma/authkeys/views.py b/kuma/authkeys/views.py index 1143ee06c37..249e1243181 100644 --- a/kuma/authkeys/views.py +++ b/kuma/authkeys/views.py @@ -11,6 +11,7 @@ ITEMS_PER_PAGE = 15 +@login_required @permission_required('authkeys.add_key', raise_exception=True) def new(request): context = {"key": None} @@ -48,6 +49,7 @@ def history(request, pk): return render(request, 'authkeys/history.html', context) +@login_required @permission_required('authkeys.delete_key', raise_exception=True) def delete(request, pk): key = get_object_or_404(Key, pk=pk) diff --git a/kuma/users/helpers.py b/kuma/users/helpers.py index 0e6a2b1b1f2..f0671bb2d49 100644 --- a/kuma/users/helpers.py +++ b/kuma/users/helpers.py @@ -55,7 +55,7 @@ def admin_link(context, user): """Returns a link to admin a user""" link = '' url = reverse('admin:auth_user_change', args=(user.id,)) - link = '%s' % (url, _('Admin')) + link = '%s' % (url, _('Admin')) return Markup(link)