Make search public and refine blacklisting
This commit is contained in:
@@ -7,6 +7,7 @@ from django.shortcuts import render
|
||||
from django.views import View
|
||||
from rest_framework.parsers import FormParser
|
||||
from rest_framework.views import APIView
|
||||
from django.contrib.auth.models import AnonymousUser
|
||||
|
||||
from core.lib.opensearch import query_results
|
||||
from core.lib.threshold import (
|
||||
@@ -24,8 +25,13 @@ class Drilldown(View):
|
||||
def get(self, request):
|
||||
#if not request.user.has_plan(self.plan_name):
|
||||
# return render(request, "denied.html")
|
||||
is_anonymous = isinstance(request.user, AnonymousUser)
|
||||
if is_anonymous:
|
||||
sizes = ["5", "10", "15", "20"]
|
||||
else:
|
||||
sizes = settings.OPENSEARCH_MAIN_SIZES
|
||||
context = {
|
||||
"sizes": settings.OPENSEARCH_MAIN_SIZES,
|
||||
"sizes": sizes,
|
||||
}
|
||||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user