diff --git a/OpenBench/config.py b/OpenBench/config.py index 800fe2c..4087e86 100644 --- a/OpenBench/config.py +++ b/OpenBench/config.py @@ -12,6 +12,9 @@ FRAMEWORK_DEFAULTS = { # Controls the Link on the sidebar 'framework' : FRAMEWORK_REPO_URL, + # Email of OpenBench instance owner + 'serveradmin' : 'andrew@grantnet.us', + # SPRT Elo bounds and type I/II errors 'sprt' : { 'elolower' : 0.00, 'eloupper' : 5.00, diff --git a/OpenBench/views.py b/OpenBench/views.py index 3c28204..7cf618a 100644 --- a/OpenBench/views.py +++ b/OpenBench/views.py @@ -111,6 +111,10 @@ def editProfile(request): def index(request, page=0, pageLength=25, greens=False, username=None, error=''): + # Get information about the logged in user + if not request.user.is_authenticated: profile = None + else: profile = Profile.objects.get(user=request.user) + # Get tests pending approval pending = Test.objects.filter(approved=False) pending = pending.exclude(finished=True) @@ -169,6 +173,7 @@ def index(request, page=0, pageLength=25, greens=False, username=None, error='') # Build context dictionary for index template data = { 'error' : error, + 'profile' : profile, 'pending' : pending, 'active' : active, 'completed' : completed[start:end], diff --git a/Templates/OpenBench/base.html b/Templates/OpenBench/base.html index f198a76..799a24d 100644 --- a/Templates/OpenBench/base.html +++ b/Templates/OpenBench/base.html @@ -12,11 +12,21 @@ + + {% if error %} -
- {{error}} -
+
+ {{error}} +
{% endif %} + + {% if request.user.is_authenticated and not profile.enabled %} +
+ {{profile.user.username}}! Your account is not enabled. + Contact the Admin ( {{config.serveradmin}} ) +
+ {% endif %} +