fix
This commit is contained in:
parent
63f0b4c98a
commit
ac3143389d
2
main.py
2
main.py
@ -1,5 +1,3 @@
|
||||
import json
|
||||
|
||||
from flask import Flask, request
|
||||
|
||||
from processor import Processor
|
||||
|
@ -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']
|
||||
|
Loading…
Reference in New Issue
Block a user