Skip to content

Commit

Permalink
[STTNHUB-245] improve: Allow to customise ID for EventML/PlanningML i…
Browse files Browse the repository at this point in the history
…ngests (#1776)
  • Loading branch information
MarkLark86 authored Mar 22, 2023
1 parent d739800 commit 2f49cd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion server/planning/feed_parsers/events_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ def set_missing_voc_policy(self):
)
self.__class__.missing_voc = "continue"

def get_item_id(self, tree: Element) -> str:
return tree.attrib["guid"]

def parse(self, tree: Element, provider=None):
self.root = tree
self.set_missing_voc_policy()

try:
guid = tree.attrib["guid"]
guid = self.get_item_id(tree)

item = {
GUID_FIELD: guid,
Expand Down
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 @@ -69,12 +69,15 @@ def set_missing_voc_policy(self):
)
self.__class__.missing_voc = "continue"

def get_item_id(self, tree: Element) -> str:
return tree.attrib["guid"]

def parse(self, tree: Element, provider=None):
self.root = tree
self.set_missing_voc_policy()

try:
guid = tree.attrib["guid"]
guid = self.get_item_id(tree)

item = {
GUID_FIELD: guid,
Expand Down

0 comments on commit 2f49cd9

Please sign in to comment.