1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-09-19 18:31:16 +00:00

Add CustomIdEndpointLinkRowAction

This commit is contained in:
Mo 2022-03-03 03:04:15 +01:00
parent 43b54215d2
commit e1d1ee2f84

View file

@ -14,6 +14,7 @@ from advlabdb.models import (
SemesterExperiment,
)
from advlabdb.utils import reportBadAttempt, userActiveSemester
from flask_admin.model.template import EndpointLinkRowAction
def adminViewIsAccessible():
@ -174,7 +175,7 @@ class SecureAssistantModelView(CustomModelView):
A default filter has to be implemented to restrict assistants read/write access.
See on_model_change!
"""
raise ModelViewException("Not implemented!")
raise NotImplementedError()
def on_model_change(self, form, model, is_created):
"""
@ -204,3 +205,11 @@ class SecureAdminBaseView(BaseView):
class SecureAssistantBaseView(BaseView):
def is_accessible(self):
return assistantViewIsAccessible()
class CustomIdEndpointLinkRowAction(EndpointLinkRowAction):
def customId(self, row):
raise NotImplementedError()
def render(self, context, row_id, row):
return super().render(context, self.customId(row), row)