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

Remove addMenuLink

This commit is contained in:
Mo 2022-09-12 17:57:13 +02:00
parent f212ddf181
commit 1d8c5db16c

View file

@ -368,26 +368,9 @@ class SemesterView(SecureAdminModelView):
transferAssistants=form.transfer_assistants.data, transferAssistants=form.transfer_assistants.data,
) )
@staticmethod
def addMenuLink(space, newSemester):
categoryText = "Active semester"
link = MenuLink(
name=str(newSemester),
url=url_for("main.set_semester") + "?semester_id=" + str(newSemester.id),
category=categoryText,
)
category = space._menu_categories.get(categoryText)
link.parent = category
category._children.insert(0, link)
def after_model_change(self, form, model, is_created): def after_model_change(self, form, model, is_created):
current_user.setActiveSemester(model) current_user.setActiveSemester(model)
SemesterView.addMenuLink(adminSpace, model)
SemesterView.addMenuLink(assistantSpace, model)
def programQueryFactory(): def programQueryFactory():
return Program.query return Program.query