Skip to content

Commit

Permalink
Merge pull request #110 from mdhaman/schedule
Browse files Browse the repository at this point in the history
fix(formatter): Set the versioncreated to current date for schedule item.
  • Loading branch information
Mayur Dhamanwala authored Sep 1, 2016
2 parents dfa183e + e2f6851 commit 5f24931
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
import re
from eve.utils import config
from superdesk.utils import json_serialize_datetime_objectId
from superdesk.utc import utcnow
from superdesk.errors import FormatterError
from superdesk.metadata.item import ITEM_TYPE, PACKAGE_TYPE
from superdesk.metadata.item import ITEM_TYPE, PACKAGE_TYPE, ITEM_STATE, CONTENT_STATE
from bs4 import BeautifulSoup
from .field_mappers.locator_mapper import LocatorMapper
from .field_mappers.slugline_mapper import SluglineMapper
Expand Down Expand Up @@ -50,6 +51,10 @@ def format(self, article, subscriber, codes=None):
if 'new zealand' in desk_name.lower().strip():
formatted_article['source'] = 'NZN'

# this is temporary fix for bulletin builder formatter
if formatted_article.get(ITEM_STATE, '') == CONTENT_STATE.SCHEDULED:
formatted_article['versioncreated'] = utcnow()

formatted_article['body_text'] = self.get_text_content(body_html)
formatted_article['abstract'] = self.get_text_content(
to_ascii(formatted_article.get('abstract', '') or '')).strip()
Expand Down

0 comments on commit 5f24931

Please sign in to comment.