1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-11-08 21:21:06 +00:00

Restricted semester label to WS and SS

This commit is contained in:
Mo 2021-07-30 00:43:05 +02:00
parent ba0691015d
commit 6036500f2a

View file

@ -351,6 +351,9 @@ class Semester(db.Model):
__table_args__ = (db.UniqueConstraint(label, year),) __table_args__ = (db.UniqueConstraint(label, year),)
def customInit(label, year, oldSemester, transferParts, transferAssistants): def customInit(label, year, oldSemester, transferParts, transferAssistants):
if label not in ("WS", "SS"):
raise DataBaseException("The semester label has to be WS or SS!")
semester = Semester(label=label, year=year) semester = Semester(label=label, year=year)
if transferParts: if transferParts: