From 2776ce8c165ccc33bb6860b83c53c7f1047267f4 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 5 Apr 2010 12:27:05 +0100 Subject: [PATCH] HR Group now a setting --- hr/views.py | 4 +++- settings.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hr/views.py b/hr/views.py index c53f8fa..255c35d 100644 --- a/hr/views.py +++ b/hr/views.py @@ -7,6 +7,8 @@ from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.template import RequestContext +import settings + from eve_api.models import EVEPlayerCorporation from hr.forms import CreateRecommendationForm, CreateApplicationForm @@ -14,7 +16,7 @@ from hr.models import Recommendation, Application def index(request): - if request.user.is_staff or 'hrstaff' in request.user.groups.all(): + if request.user.is_staff or settings.HR_STAFF_GROUP in request.user.groups.all(): hrstaff = True return render_to_response('hr/index.html', locals(), context_instance=RequestContext(request)) diff --git a/settings.py b/settings.py index 0f0dd26..b75c003 100644 --- a/settings.py +++ b/settings.py @@ -141,3 +141,7 @@ MINING_DATABASE = 'dreddit_mining' # Mining buddy secret key (in the config) MINING_SALT = 's98ss7fsc7fd2rf62ctcrlwztstnzve9toezexcsdhfgviuinusxcdtsvbrg' +### HR Settings + +HR_STAFF_GROUP = 'hrstaff' +