Skip to content

Commit

Permalink
Make some fields optional
Browse files Browse the repository at this point in the history
SDESK-7441
  • Loading branch information
eos87 committed Nov 29, 2024
1 parent b85a4e2 commit d6cb71c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/planning/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class ScheduledUpdate:
@dataclass
class PlanningCoverage:
# Identifiers
coverage_id: fields.Keyword
coverage_id: fields.Keyword | None = None
original_coverage_id: fields.Keyword | None = None
guid: fields.Keyword | None = None

Expand Down
6 changes: 4 additions & 2 deletions server/planning/types/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ class EventResourceModel(BasePlanningModel, LockFieldsMixin):
participant: list[KeywordQCodeName | None] = Field(default_factory=list)
participant_requirement: list[KeywordQCodeName | None] = Field(default_factory=list)
organizer: list[KeywordQCodeName | None] = Field(default_factory=list)
event_contact_info: Annotated[list[fields.ObjectId], validate_data_relation_async("contacts")]
event_contact_info: Annotated[list[fields.ObjectId], validate_data_relation_async("contacts")] = Field(
default_factory=list
)
language: fields.Keyword | None = None
languages: list[fields.Keyword] = Field(default_factory=list)

Expand Down Expand Up @@ -259,7 +261,7 @@ class EventResourceModel(BasePlanningModel, LockFieldsMixin):
# HACK: end. We'll try to move these hacks somewhere else

extra: Annotated[dict[str, Any], fields.dynamic_mapping()] = Field(default_factory=dict)
translations: Annotated[list[Translation], fields.nested_list()]
translations: Annotated[list[Translation], fields.nested_list()] = Field(default_factory=list)

# This is used from the EmbeddedCoverage form in the Event editor
# This list is NOT stored with the Event
Expand Down

0 comments on commit d6cb71c

Please sign in to comment.