diff --git a/app/hr/utils.py b/app/hr/utils.py index b514343..76a761b 100644 --- a/app/hr/utils.py +++ b/app/hr/utils.py @@ -27,7 +27,7 @@ def blacklist_values(user, level=BLACKLIST_LEVEL_NOTE): """ 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 if installed('reddit'): diff --git a/app/hr/views.py b/app/hr/views.py index 9cb87ed..90c7c2a 100644 --- a/app/hr/views.py +++ b/app/hr/views.py @@ -64,7 +64,9 @@ def check_permissions(user, application=None): @login_required def index(request): 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)) ### Application Management