mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Fixed last semester
This commit is contained in:
parent
6fab47591f
commit
e85b56444a
2 changed files with 3 additions and 3 deletions
|
@ -13,7 +13,7 @@ def randomPassword():
|
|||
|
||||
|
||||
def userActiveSemester(flashWarning=False):
|
||||
lastSemesterId = Semester.query.order_by(Semester.year.desc()).order_by(Semester.id.desc()).first().id
|
||||
lastSemesterId = Semester.query.order_by(Semester.year.desc()).order_by(Semester.label.desc()).first().id
|
||||
if current_user.active_semester_id is None:
|
||||
current_user.active_semester_id = lastSemesterId
|
||||
db.session.commit()
|
||||
|
|
|
@ -17,8 +17,8 @@ with app.app_context():
|
|||
db.session.add(program2)
|
||||
db.session.add(program3)
|
||||
|
||||
sem1 = Semester(label="WS", year=21)
|
||||
sem2 = Semester(label="SS", year=21)
|
||||
sem1 = Semester(label="SS", year=22)
|
||||
sem2 = Semester(label="WS", year=22)
|
||||
|
||||
db.session.add(sem1)
|
||||
db.session.add(sem2)
|
||||
|
|
Loading…
Reference in a new issue