Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

Custom types replaced with proper custom_types_category value

Eric Howard86b254bbf9a9
diff --git a/flowsint-api/alembic/versions/f4d42260273d_add_category_to_custom_types.py b/flowsint-api/alembic/versions/f4d42260273d_add_category_to_custom_types.py
index da320699..5e39bc97 100644
--- a/flowsint-api/alembic/versions/f4d42260273d_add_category_to_custom_types.py
+++ b/flowsint-api/alembic/versions/f4d42260273d_add_category_to_custom_types.py
@@ -5,6 +5,7 @@ Revises: a1f2b3c4d5e6
Create Date: 2026-06-06 14:47:31.692222
"""
+
from typing import Sequence, Union
from alembic import op
@@ -12,8 +13,8 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
-revision: str = 'f4d42260273d'
-down_revision: Union[str, None] = 'a1f2b3c4d5e6'
+revision: str = "f4d42260273d"
+down_revision: Union[str, None] = "a1f2b3c4d5e6"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
@@ -21,12 +22,20 @@ depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
- op.add_column('custom_types', sa.Column('category', sa.String(), server_default='Custom types', nullable=False))
+ op.add_column(
+ "custom_types",
+ sa.Column(
+ "category",
+ sa.String(),
+ server_default="custom_types_category",
+ nullable=False,
+ ),
+ )
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
- op.drop_column('custom_types', 'category')
+ op.drop_column("custom_types", "category")
# ### end Alembic commands ###
diff --git a/flowsint-api/app/api/schemas/custom_type.py b/flowsint-api/app/api/schemas/custom_type.py
index 429cce3d..f3bd9eec 100644
--- a/flowsint-api/app/api/schemas/custom_type.py
+++ b/flowsint-api/app/api/schemas/custom_type.py
@@ -19,7 +19,9 @@ class CustomTypeCreate(BaseModel):
None, description="Optional description of the custom type"
)
status: str = Field("draft", description="Status of the custom type")
- category: str = Field("Custom types", description="Category of the custom type")
+ category: str = Field(
+ "custom_types_category", description="Category of the custom type"
+ )
color: str = Field("#8E9E8C", description="Default color")
icon: str = Field("Minus", description="Default icon")
diff --git a/flowsint-core/src/flowsint_core/core/models.py b/flowsint-core/src/flowsint_core/core/models.py
index 6fc436cc..2b6eab6a 100644
--- a/flowsint-core/src/flowsint_core/core/models.py
+++ b/flowsint-core/src/flowsint_core/core/models.py
@@ -362,7 +362,7 @@ class CustomType(Base):
color: Mapped[str] = mapped_column(String, nullable=True)
status: Mapped[str] = mapped_column(String, server_default="draft", nullable=False)
category: Mapped[str] = mapped_column(
- String, server_default="Custom types", nullable=False
+ String, server_default="custom_types_category", nullable=False
)
checksum: Mapped[str] = mapped_column(String, nullable=True)
description: Mapped[str] = mapped_column(Text, nullable=True)
diff --git a/flowsint-core/src/flowsint_core/core/services/custom_type_service.py b/flowsint-core/src/flowsint_core/core/services/custom_type_service.py
index 987c934f..85ab7f1f 100644
--- a/flowsint-core/src/flowsint_core/core/services/custom_type_service.py
+++ b/flowsint-core/src/flowsint_core/core/services/custom_type_service.py
@@ -48,7 +48,7 @@ class CustomTypeService(BaseService):
user_id: UUID,
description: Optional[str] = None,
status: str = "draft",
- category: str = "Custom types",
+ category: str = "custom_types_category",
validate_schema_func=None,
calculate_checksum_func=None,
) -> CustomType: