Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue with all bulk actions and removes dupe duplicates in IncidentRead Pydantic model #2997

Merged
merged 3 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/dispatch/incident/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from dispatch.report.enums import ReportTypes
from dispatch.report.models import ReportRead
from dispatch.storage.models import StorageRead
from dispatch.tag.models import TagRead, TagReadMinimal
from dispatch.tag.models import TagRead
from dispatch.task.enums import TaskStatus
from dispatch.term.models import TermRead
from dispatch.ticket.models import TicketRead
Expand Down Expand Up @@ -299,7 +299,7 @@ class IncidentReadMinimal(IncidentBase):
reporter: Optional[ParticipantReadMinimal]
reporters_location: Optional[str]
stable_at: Optional[datetime] = None
tags: Optional[List[TagReadMinimal]] = []
tags: Optional[List[TagRead]] = []
total_cost: Optional[float]


Expand Down Expand Up @@ -347,7 +347,6 @@ class IncidentRead(IncidentBase):
created_at: Optional[datetime] = None
documents: Optional[List[DocumentRead]] = []
duplicates: Optional[List[IncidentReadMinimal]] = []
duplicates: Optional[List[IncidentReadMinimal]] = []
events: Optional[List[EventRead]] = []
incident_costs: Optional[List[IncidentCostRead]] = []
incident_priority: IncidentPriorityRead
Expand All @@ -365,8 +364,8 @@ class IncidentRead(IncidentBase):
reporters_location: Optional[str]
stable_at: Optional[datetime] = None
storage: Optional[StorageRead] = None
tasks: Optional[List[TaskRead]] = []
tags: Optional[List[TagRead]] = []
tasks: Optional[List[TaskRead]] = []
terms: Optional[List[TermRead]] = []
ticket: Optional[TicketRead] = None
total_cost: Optional[float]
Expand Down
12 changes: 1 addition & 11 deletions src/dispatch/tag/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from dispatch.database.core import Base
from dispatch.models import DispatchBase, TimeStampMixin, ProjectMixin, PrimaryKey
from dispatch.project.models import ProjectRead
from dispatch.tag_type.models import TagTypeRead, TagTypeCreate, TagTypeUpdate, TagTypeReadMinimal
from dispatch.tag_type.models import TagTypeRead, TagTypeCreate, TagTypeUpdate


class Tag(Base, TimeStampMixin, ProjectMixin):
Expand Down Expand Up @@ -57,16 +57,6 @@ class TagRead(TagBase):
project: ProjectRead


class TagReadMinimal(DispatchBase):
id: PrimaryKey
name: Optional[str] = Field(None, nullable=True)
source: Optional[str] = Field(None, nullable=True)
uri: Optional[str] = Field(None, nullable=True)
discoverable: Optional[bool] = True
description: Optional[str] = Field(None, nullable=True)
tag_type: Optional[TagTypeRead]


class TagPagination(DispatchBase):
items: List[TagRead]
total: int
7 changes: 0 additions & 7 deletions src/dispatch/tag_type/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ class TagTypeRead(TagTypeBase):
project: ProjectRead


class TagTypeReadMinimal(DispatchBase):
id: PrimaryKey
name: NameStr
exclusive: Optional[bool] = False
description: Optional[str] = Field(None, nullable=True)


class TagTypePagination(DispatchBase):
items: List[TagTypeRead]
total: int