Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkLark86 committed Feb 2, 2024
1 parent 82fc798 commit 33ab2d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 1 addition & 5 deletions server/planning/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,6 @@ def update_ingest_on_patch(updates: Dict[str, Any], original: Dict[str, Any]):

def get_coverage_from_planning(planning_item: Planning, coverage_id: str) -> Optional[Coverage]:
return next(
(
coverage
for coverage in planning_item.get("coverages") or []
if coverage.get("coverage_id") == coverage_id
),
(coverage for coverage in planning_item.get("coverages") or [] if coverage.get("coverage_id") == coverage_id),
None,
)
5 changes: 4 additions & 1 deletion server/planning/feed_parsers/superdesk_planning_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,11 @@ def get_coverage_details(self, news_coverage_elt: Element, item: Planning, origi
"""

coverage_id = news_coverage_elt.get("id")
planning = self.parse_coverage_planning(news_coverage_elt, item)
if coverage_id is None:
logger.warning("Unable to process coverage details, no coverage id found in ingest source")
return None

planning = self.parse_coverage_planning(news_coverage_elt, item)
if planning is None:
logger.warning(f"Failed to process coverage '{coverage_id}', planning details not found")
return None
Expand Down

0 comments on commit 33ab2d4

Please sign in to comment.