diff --git a/app/admin/views.py b/app/admin/views.py index 998718ff6f595c17b2de2a2a5895b0db0f806be7..d159e8774d72c901a711f99e8a233d63e65504f2 100644 --- a/app/admin/views.py +++ b/app/admin/views.py @@ -85,3 +85,8 @@ class NetworkAdmin(AdminModelView): form_overrides = { 'vlan_name': fields.StringField, } + + +class TaskAdmin(AdminModelView): + column_display_pk = True + can_create = False diff --git a/app/factory.py b/app/factory.py index afea592076303f0bb5f1ab0fad5f0bb374f52cfb..b6116574e9bf654af6c8cc95e78b6ce9bf886567 100644 --- a/app/factory.py +++ b/app/factory.py @@ -17,7 +17,7 @@ from . import settings, models from .extensions import (db, migrate, login_manager, ldap_manager, bootstrap, admin, mail, jwt, toolbar, session_redis_store, fsession, cache) from .admin.views import (AdminModelView, ItemAdmin, UserAdmin, TokenAdmin, - NetworkAdmin) + NetworkAdmin, TaskAdmin) from .main.views import bp as main from .inventory.views import bp as inventory from .network.views import bp as network @@ -112,6 +112,7 @@ def create_app(config=None): admin.add_view(AdminModelView(models.Mac, db.session)) admin.add_view(AdminModelView(models.Cname, db.session)) admin.add_view(AdminModelView(models.Tag, db.session)) + admin.add_view(TaskAdmin(models.Task, db.session)) app.register_blueprint(main) app.register_blueprint(inventory, url_prefix='/inventory')