Refreshs
This commit is contained in:
12
routing.py
12
routing.py
@ -7,6 +7,7 @@ from werkzeug.security import generate_password_hash, check_password_hash
|
||||
import hashlib
|
||||
import datetime
|
||||
import time
|
||||
import random
|
||||
|
||||
import fetchDUALIS
|
||||
import fetchRAPLA
|
||||
@ -36,7 +37,7 @@ def welcome():
|
||||
return redirect(url_for("getKurs", next=url_for(request.endpoint)))
|
||||
sel = request.args.get("sel")
|
||||
if not sel:
|
||||
sel="theorie"
|
||||
sel = "theorie"
|
||||
kurs = current_user.kurs
|
||||
name = current_user.name
|
||||
if sel == "theorie":
|
||||
@ -151,7 +152,8 @@ def getKurs():
|
||||
kurs = fetchDUALIS.getKurs(d.token, cookie)
|
||||
if kurs != 0:
|
||||
if not fetchRAPLA.getIcal(kurs):
|
||||
return render_template('kurs.html', detected=(kurs, e), s="s", theorie="hidden", praxis="hidden", file=False)
|
||||
return render_template('kurs.html', detected=(kurs, e), s="s", theorie="hidden", praxis="hidden",
|
||||
file=False)
|
||||
current_user.kurs = kurs
|
||||
db.session.commit()
|
||||
else:
|
||||
@ -163,7 +165,7 @@ def getKurs():
|
||||
else:
|
||||
e = True
|
||||
kurs = ""
|
||||
return render_template('kurs.html', detected=(kurs, e), s="s", theorie="hidden", praxis="hidden", file=True)
|
||||
return render_template('kurs.html', detected=(kurs, e), s="s", theorie="hidden", praxis="hidden", file=True)
|
||||
|
||||
|
||||
@app.route("/set-up/semester")
|
||||
@ -176,7 +178,7 @@ def getSemester():
|
||||
t = Dualis.query.filter_by(uid=current_user.id).first().token
|
||||
c = request.cookies.get("cnsc")
|
||||
|
||||
return render_template("semester.html", semester=fetchDUALIS.getSem(t, c), s="s", theorie="hidden", praxis="hidden")
|
||||
return render_template("semester.html", semester=fetchDUALIS.getSem(t, c), s="s", theorie="hidden", praxis="hidden")
|
||||
|
||||
|
||||
@app.route("/set-up/semester", methods=["POST"])
|
||||
@ -203,7 +205,7 @@ def chooseRaplas():
|
||||
:return HTML:
|
||||
"""
|
||||
r = getRaplas()
|
||||
return render_template("rapla.html", raplas=r, s="s", theorie="hidden", praxis="hidden")
|
||||
return render_template("rapla.html", raplas=r, s="s", theorie="hidden", praxis="hidden")
|
||||
|
||||
|
||||
@app.route("/set-up/rapla", methods=["POST"])
|
||||
|
||||
Reference in New Issue
Block a user