mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Allow admins to choose a done semester as active semester
This commit is contained in:
parent
429ea37c40
commit
399ca4b198
3 changed files with 4 additions and 4 deletions
|
@ -128,7 +128,7 @@ class UserView(SecureAdminModelView):
|
|||
|
||||
@staticmethod
|
||||
def semesterQueryFactory():
|
||||
return Semester.query.order_by(Semester.id.desc()).where(Semester.done == False)
|
||||
return Semester.query.order_by(Semester.id.desc())
|
||||
|
||||
@staticmethod
|
||||
def default_roles():
|
||||
|
|
|
@ -53,7 +53,7 @@ class AssistantGroupExperimentView(SecureAssistantModelView):
|
|||
if not semester_changed:
|
||||
flash(
|
||||
Markup(
|
||||
f"Active semester {active_semester} is marked as done. Therefore, you are not allowed to view or edit any marks in this semester. You should change your active semester in <a href='{ user_settings_url() }'>user settings</a> if possible."
|
||||
f"Active semester {active_semester} is set as done. Therefore, you are not allowed to view or edit any marks in this semester. You should change your active semester in <a href='{ user_settings_url() }'>user settings</a> if possible."
|
||||
),
|
||||
"danger",
|
||||
)
|
||||
|
@ -218,7 +218,7 @@ class AssistantUserView(SecureAssistantModelView):
|
|||
query_factory=semesterQueryFactory,
|
||||
validators=[DataRequired()],
|
||||
default=Semester.lastSemester,
|
||||
description="You should change the active semester to the last semester. Do not forget to click save! Only last two semesters are shown that are not marked as done.",
|
||||
description="You should change the active semester to the last semester. Do not forget to click save! Only last two semesters are shown that are not set as done.",
|
||||
)
|
||||
|
||||
phone_number, mobile_phone_number, building, room = user_info_fields()
|
||||
|
|
|
@ -724,7 +724,7 @@ class User(db.Model, FsUserMixin):
|
|||
return False
|
||||
else:
|
||||
flash(
|
||||
f"Active semester changed to {last_semester} because your last active semester was marked as done!",
|
||||
f"Active semester changed to {last_semester} because your last active semester was set as done!",
|
||||
"warning",
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue