cleanup
parent
c77d7b1cff
commit
2e2a986028
7
app.py
7
app.py
|
@ -1,4 +1,3 @@
|
||||||
import os
|
|
||||||
from flask import Flask, redirect, render_template, session, request, url_for, flash
|
from flask import Flask, redirect, render_template, session, request, url_for, flash
|
||||||
|
|
||||||
from auth import login_required, bp as auth_bp
|
from auth import login_required, bp as auth_bp
|
||||||
|
@ -47,9 +46,6 @@ def create_app(test_config=None):
|
||||||
deck_query.filter(Deck)
|
deck_query.filter(Deck)
|
||||||
return index()
|
return index()
|
||||||
|
|
||||||
|
|
||||||
deck_id = deck_object.id
|
|
||||||
|
|
||||||
# Smo oddali obrazec?
|
# Smo oddali obrazec?
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
card_id = request.form.get('card_id', None)
|
card_id = request.form.get('card_id', None)
|
||||||
|
@ -74,7 +70,6 @@ def create_app(test_config=None):
|
||||||
if not rate:
|
if not rate:
|
||||||
raise Exception("manjka rate info!")
|
raise Exception("manjka rate info!")
|
||||||
|
|
||||||
|
|
||||||
if rate == "Yes":
|
if rate == "Yes":
|
||||||
submit_card.interest_rate = 1
|
submit_card.interest_rate = 1
|
||||||
|
|
||||||
|
@ -104,6 +99,7 @@ def create_app(test_config=None):
|
||||||
|
|
||||||
deck_object.current_card = next_card
|
deck_object.current_card = next_card
|
||||||
dbsession.commit()
|
dbsession.commit()
|
||||||
|
dbsession.close()
|
||||||
|
|
||||||
# Loudamo naslednjo karto v decku
|
# Loudamo naslednjo karto v decku
|
||||||
show_card_index = deck_object.current_card
|
show_card_index = deck_object.current_card
|
||||||
|
@ -130,6 +126,7 @@ def create_app(test_config=None):
|
||||||
print("share!!!")
|
print("share!!!")
|
||||||
return redirect(url_for("deck"))
|
return redirect(url_for("deck"))
|
||||||
|
|
||||||
|
|
||||||
@app.route('/logout')
|
@app.route('/logout')
|
||||||
def logout():
|
def logout():
|
||||||
session.pop("user_id", None)
|
session.pop("user_id", None)
|
||||||
|
|
Loading…
Reference in New Issue