This commit is contained in:
Administrator 2022-10-04 12:46:48 +03:00
parent 63f0b4c98a
commit ac3143389d
2 changed files with 1 additions and 3 deletions

View File

@ -1,5 +1,3 @@
import json
from flask import Flask, request
from processor import Processor

View File

@ -15,7 +15,7 @@ class Processor:
def next(self):
count_docs = mongo.jokes_collection.count_documents({})
rnd = random.randrange(count_docs)
rnd = random.randrange(1, count_docs + 1)
anek = mongo.jokes_collection.find_one({"id": rnd})
return {
"text": anek['text']