Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return render(request, 'wagtailmedia/media/results.html', {
'ordering': ordering,
'media_files': media,
'query_string': query_string,
'is_searching': bool(query_string),
})
else:
return render(request, 'wagtailmedia/media/index.html', {
'ordering': ordering,
'media_files': media,
'query_string': query_string,
'is_searching': bool(query_string),
'search_form': form,
'popular_tags': popular_tags_for_model(Media),
'user_can_add': permission_policy.user_has_permission(request.user, 'add'),
'collections': collections,
'current_collection': current_collection,
})