We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05f5666 commit 1350ca2Copy full SHA for 1350ca2
main/views.py
@@ -85,7 +85,7 @@ def update_data(request):
85
def generate_random_snippets(request):
86
try:
87
count = request.GET.get('q')
88
- if count > Component.objects.filter(sniperdata__isnull=False).count():
+ if int(count) > Component.objects.filter(sniperdata__isnull=False).count():
89
return HttpResponse('Input number "q" must not exceed %s.'%str(Component.objects.filter(sniperdata__isnull=False).count()))
90
components = Component.objects.filter(sniperdata__isnull=False)
91
required_components = np.random.choice(components, int(count), replace=False)
0 commit comments