Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def index(request):
# Get Videos (filtered by user permission)
videos = Video.objects.all()
# Search
query_string = None
if 'q' in request.GET:
form = SearchForm(request.GET, placeholder=_("Search videos"))
if form.is_valid():
query_string = form.cleaned_data['q']
videos = videos.search(query_string)
else:
form = SearchForm(placeholder=_("Search videos"))
# Filter by collection
current_collection = None
collection_id = request.GET.get('collection_id')
if collection_id: