From 39b1f7a05d421d04bb0c167a7ad745aefd68943c Mon Sep 17 00:00:00 2001 From: romeonicholas Date: Tue, 14 Nov 2023 09:22:26 +0100 Subject: [PATCH] fix: Remove excess declaration and format files --- ...0e2028f83156_add_user_determined_display_order_to_.py | 9 +++++---- backend/capellacollab/projects/toolmodels/models.py | 3 --- backend/capellacollab/projects/toolmodels/routes.py | 9 ++++++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/backend/capellacollab/alembic/versions/0e2028f83156_add_user_determined_display_order_to_.py b/backend/capellacollab/alembic/versions/0e2028f83156_add_user_determined_display_order_to_.py index 0d0af7087c..bb2f2da59a 100644 --- a/backend/capellacollab/alembic/versions/0e2028f83156_add_user_determined_display_order_to_.py +++ b/backend/capellacollab/alembic/versions/0e2028f83156_add_user_determined_display_order_to_.py @@ -11,13 +11,14 @@ import sqlalchemy as sa from alembic import op - # revision identifiers, used by Alembic. -revision = '0e2028f83156' -down_revision = 'ac0e6e0f77ee' +revision = "0e2028f83156" +down_revision = "ac0e6e0f77ee" branch_labels = None depends_on = None def upgrade(): - op.add_column('models', sa.Column('display_order', sa.Integer(), nullable=True)) + op.add_column( + "models", sa.Column("display_order", sa.Integer(), nullable=True) + ) diff --git a/backend/capellacollab/projects/toolmodels/models.py b/backend/capellacollab/projects/toolmodels/models.py index ae87ca2335..58ace45a99 100644 --- a/backend/capellacollab/projects/toolmodels/models.py +++ b/backend/capellacollab/projects/toolmodels/models.py @@ -78,8 +78,6 @@ class DatabaseCapellaModel(database.Base): configuration: orm.Mapped[dict[str, str] | None] - display_order: orm.Mapped[int | None] = orm.mapped_column() - project_id: orm.Mapped[int] = orm.mapped_column( sa.ForeignKey("projects.id") ) @@ -127,6 +125,5 @@ class CapellaModel(pydantic.BaseModel): nature: tools_models.ToolNatureBase | None = None git_models: list[GitModel] | None = None t4c_models: list[T4CModel] | None = None - display_order: int | None = None restrictions: restrictions_models.ToolModelRestrictions | None = None diff --git a/backend/capellacollab/projects/toolmodels/routes.py b/backend/capellacollab/projects/toolmodels/routes.py index 25f9d080c1..25a36f3f94 100644 --- a/backend/capellacollab/projects/toolmodels/routes.py +++ b/backend/capellacollab/projects/toolmodels/routes.py @@ -183,7 +183,14 @@ def patch_tool_model( new_project = model.project return crud.update_model( - db, model, body.description, body.name, version, nature, new_project, body.display_order + db, + model, + body.description, + body.name, + version, + nature, + new_project, + body.display_order, )