diff --git a/advlabdb/customClasses.py b/advlabdb/customClasses.py index c7deba0..5323152 100644 --- a/advlabdb/customClasses.py +++ b/advlabdb/customClasses.py @@ -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)