From 0bdf8ef3f32da3fcda1d5e6e56c087154a97e263 Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Thu, 24 Oct 2019 09:13:59 -0500 Subject: [PATCH] limit visibiltiy of orgs to admin (#5374) --- app/marketing/views.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/marketing/views.py b/app/marketing/views.py index d2ba529e723..0a3eba7ae4e 100644 --- a/app/marketing/views.py +++ b/app/marketing/views.py @@ -55,7 +55,7 @@ def get_settings_navs(request): - return [{ + tabs = [{ 'body': _('Email'), 'href': reverse('email_settings', args=('', )) }, { @@ -85,11 +85,16 @@ def get_settings_navs(request): }, { 'body': _('Job Status'), 'href': reverse('job_settings'), - }, { - 'body': _('Organizations'), - 'href': reverse('org_settings'), }] + if request.user.is_staff: + tabs.append({ + 'body': _('Organizations'), + 'href': reverse('org_settings'), + }) + + return tabs + def settings_helper_get_auth(request, key=None): # setup @@ -668,6 +673,7 @@ def job_settings(request): return TemplateResponse(request, 'settings/job.html', context) +@staff_member_required def org_settings(request): """Display and save user's Account settings.