Fixes some small issues with HR

This commit is contained in:
2011-08-10 09:12:52 +01:00
parent 920294d135
commit dcc0f2102d
2 changed files with 4 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ def blacklist_values(user, level=BLACKLIST_LEVEL_NOTE):
""" """
blacklist = [] blacklist = []
bl_items = Blacklist.objects.filter(level__lte=level, models.Q(expiry_date__gt=datetime.now()) | models.Q(expiry_date=None)) bl_items = Blacklist.objects.filter(models.Q(expiry_date__gt=datetime.now()) | models.Q(expiry_date=None), level__lte=level)
# Check Reddit blacklists # Check Reddit blacklists
if installed('reddit'): if installed('reddit'):

View File

@@ -64,7 +64,9 @@ def check_permissions(user, application=None):
@login_required @login_required
def index(request): def index(request):
hrstaff = check_permissions(request.user) hrstaff = check_permissions(request.user)
can_recommend = len(blacklist_values(request.user, BLACKLIST_LEVEL_ADVISORY)) can_recommend = False
if len(blacklist_values(request.user, BLACKLIST_LEVEL_ADVISORY)) == 0:
can_recommend = True
return render_to_response('hr/index.html', locals(), context_instance=RequestContext(request)) return render_to_response('hr/index.html', locals(), context_instance=RequestContext(request))
### Application Management ### Application Management