a 0-card deck error fixed
parent
c9dacc978e
commit
a9de33dfb8
9
menu.py
9
menu.py
|
@ -1,5 +1,5 @@
|
|||
from flask import (
|
||||
Blueprint, redirect, render_template, request, session, url_for
|
||||
Blueprint, flash, redirect, render_template, request, session, url_for
|
||||
)
|
||||
|
||||
from config import CONFIG
|
||||
|
@ -48,10 +48,11 @@ def index():
|
|||
#ustvari novi vnos v Deck
|
||||
user_settings = get_settings(user_id)
|
||||
deck = probabilistic_deck_generator(user_id, int(user_settings['max_new']), int(user_settings['max_due']))
|
||||
|
||||
cards_by_id = get_deck(deck)
|
||||
if cards_by_id == None:
|
||||
print("Deck is none")
|
||||
return render_template(index())
|
||||
if cards_by_id == "":
|
||||
flash("Error: Attempted to make deck with 0 cards. Maybe check settings :)")
|
||||
return render_template("menu/menu.html")
|
||||
else:
|
||||
number_of_cards = len(cards_by_id.split(","))
|
||||
|
||||
|
|
Loading…
Reference in New Issue