mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Remove addMenuLink
This commit is contained in:
parent
f212ddf181
commit
1d8c5db16c
1 changed files with 0 additions and 17 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue