Skip to content

Commit

Permalink
Suggested fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMwangi21 committed Dec 16, 2024
1 parent 6af1319 commit 3d5c720
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions server/planning/assignments/delivery_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from planning.core.service import BasePlanningAsyncService
from planning.types import DeliveryResourceModel
from superdesk.core.resources import AsyncResourceService


class DeliveryAsyncService(BasePlanningAsyncService[DeliveryResourceModel]):
class DeliveryAsyncService(AsyncResourceService[DeliveryResourceModel]):
pass
5 changes: 4 additions & 1 deletion server/planning/assignments/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,26 @@
name="planning_id_1",
keys=[("planning_id", 1)],
background=True,
unique=False,
),
MongoIndexOptions(
name="assignment_id_1",
keys=[("assignment_id", 1)],
background=True,
unique=False,
),
MongoIndexOptions(
name="coverage_id_1",
keys=[("coverage_id", 1)],
background=True,
unique=False,
),
MongoIndexOptions(
name="item_id_1",
keys=[("item_id", 1)],
background=True,
unique=False,
),
],
),
elastic=ElasticResourceConfig(),
)
5 changes: 2 additions & 3 deletions server/planning/types/delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
from typing import Annotated
from datetime import datetime

from superdesk.core.resources import fields
from superdesk.core.resources import ResourceModelWithObjectId, fields
from superdesk.core.resources.validators import validate_data_relation_async
from .base import BasePlanningModel


class DeliveryResourceModel(BasePlanningModel):
class DeliveryResourceModel(ResourceModelWithObjectId):
planning_id: Annotated[fields.Keyword, validate_data_relation_async("planning")]
coverage_id: str | None = None
assignment_id: Annotated[fields.ObjectId, validate_data_relation_async("assignments")]
Expand Down

0 comments on commit 3d5c720

Please sign in to comment.