Skip to content

Commit

Permalink
fix(formatter) Set the versioncreated to current date for schedule item.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayur Dhamanwala committed Sep 1, 2016
1 parent b5ecf31 commit e2f6851
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 e2f6851

Please sign in to comment.