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

Explicit expose

This commit is contained in:
Mo 2022-03-04 03:49:02 +01:00
parent 3c7b578352
commit 027851b398
3 changed files with 12 additions and 8 deletions

View file

@ -1,6 +1,6 @@
from pathlib import Path
from flask import flash, redirect, request, url_for, has_request_context
from flask import flash, has_request_context, redirect, request, url_for
from flask_admin import expose
from flask_admin.contrib.sqla.fields import QuerySelectField, QuerySelectMultipleField
from flask_admin.contrib.sqla.filters import FilterEqual
@ -26,10 +26,15 @@ from wtforms.validators import URL, DataRequired, Email, NumberRange, Optional
from advlabdb import adminSpace, app, assistantSpace, db, user_datastore
from advlabdb.configUtils import getConfig
from advlabdb.customClasses import SecureAdminBaseView, SecureAdminModelView, CustomIdEndpointLinkRowAction
from advlabdb.customClasses import (
CustomIdEndpointLinkRowAction,
SecureAdminBaseView,
SecureAdminModelView,
)
from advlabdb.database_import import importFromFile
from advlabdb.exceptions import DataBaseException, ModelViewException
from advlabdb.models import (
Admin,
Appointment,
Assistant,
Experiment,
@ -44,7 +49,6 @@ from advlabdb.models import (
SemesterExperiment,
Student,
User,
Admin,
)
from advlabdb.utils import (
flashRandomPassword,
@ -1368,7 +1372,7 @@ class ImportView(SecureAdminBaseView):
class DocsView(SecureAdminBaseView):
@expose()
@expose("/")
def index(self):
return self.render("docs/admin.html")

View file

@ -179,7 +179,7 @@ class AssistantUserView(SecureAssistantModelView):
class AssistantDocsView(SecureAssistantBaseView):
@expose()
@expose("/")
def index(self):
return self.render("docs/assistant.html")

View file

@ -1,6 +1,7 @@
from flask import flash, redirect, request, url_for
from flask_admin import AdminIndexView, BaseView, expose
from flask_admin.contrib.sqla import ModelView
from flask_admin.model.template import EndpointLinkRowAction
from flask_security import current_user
from sqlalchemy import and_
@ -14,7 +15,6 @@ from advlabdb.models import (
SemesterExperiment,
)
from advlabdb.utils import reportBadAttempt, userActiveSemester
from flask_admin.model.template import EndpointLinkRowAction
def adminViewIsAccessible():
@ -35,7 +35,7 @@ class SecureAdminIndexView(CustomIndexView):
def is_accessible(self):
return adminViewIsAccessible()
@expose()
@expose("/")
def index(self):
active_semester_experiment_marks_query = ExperimentMark.query.filter(
ExperimentMark.part_student.has(PartStudent.part.has(Part.semester == userActiveSemester()))
@ -58,7 +58,7 @@ class SecureAssistantIndexView(CustomIndexView):
def is_accessible(self):
return assistantViewIsAccessible()
@expose()
@expose("/")
def index(self):
active_semester_experiment_marks_query = ExperimentMark.query.filter(
ExperimentMark.group_experiment.has(