Setup Tests
This commit is contained in:
@ -9,7 +9,7 @@ import icalendar
|
||||
from icalendar import Calendar, Event
|
||||
import json
|
||||
|
||||
from init import scheduler, app, Rapla, db
|
||||
from init import scheduler, flask_app, Rapla, db
|
||||
|
||||
|
||||
async def fetchPlan(session, url):
|
||||
@ -98,7 +98,7 @@ def getIcal(kurs: str):
|
||||
rapla = Rapla.query.filter(Rapla.name == kurs).first()
|
||||
try:
|
||||
return rapla.file
|
||||
except KeyError:
|
||||
except AttributeError or KeyError:
|
||||
return None
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ async def refreshRapla():
|
||||
|
||||
@scheduler.task('cron', id="raplaschedule", hour='*', day_of_week='*', minute='*/3', week='*', second='40')
|
||||
def raplaSchedule():
|
||||
with app.app_context():
|
||||
with flask_app.app_context():
|
||||
asyncio.run(refreshRapla())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user