fix quotes error

This commit is contained in:
samerbam 2023-08-22 22:37:32 -04:00
parent b91930cd95
commit e19b3ea42c
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ class TodoDatabase:
def get_random_quote(self):
# print(time.time())
if time.time()-self.database["quotes_last_updated"] > 86400:
if ("quotes_last_updated" in self.database) and (time.time()-self.database["quotes_last_updated"] > 86400):
self._update_quotes()
quote = random.choice(self.database["quotes"])

View File

@ -36,9 +36,9 @@ import wonderwords
from datetime import datetime
# from .sudoku_generator import *
# from .wordsearch_generator import WordSearch
from database import TodoDatabase
from .sudoku_generator import *
from .wordsearch_generator import WordSearch
from .database import TodoDatabase