Skip to content

Commit

Permalink
Merge pull request #104 from mitmedialab/dsjen/news-db-fix
Browse files Browse the repository at this point in the history
Fix news task
  • Loading branch information
dsjen authored Jan 23, 2019
2 parents e58af82 + ad488cc commit 46df1ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/app/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export const DELETE_USER_REQUEST = 'DELETE_USER_REQUEST';
export const DELETE_USER_SUCCESS = 'DELETE_USER_SUCCESS';
export const DELETE_USER_FAILURE = 'DELETE_USER_FAILURE';

export const VERSION = 'v1.9.0';
export const VERSION = 'v1.9.1';

export const API_URL = ''; // process.env.NODE_ENV === 'production' ? '': 'http://localhost:5000/'
8 changes: 4 additions & 4 deletions server/scripts/queue_latest_news_posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def queue_one_news_post(post, source, quintile, db_session):
added_new = False
try:
post_id = post['id_str'] if 'id_str' in post else str(post['id'])
post_item = Post.query.filter_by(original_id=post_id, source=source).first()
if not post_item:
post_item = db_session.query(Post).filter_by(original_id=post_id, source=source).first()
if post_item:
post_item.update_content(post, is_news=True)
else:
post_item = Post(post_id, source, post, True)
db_session.add(post_item)
added_new = True
else:
post_item.update_content(post, is_news=True)

post_item.political_quintile = quintile

Expand Down

0 comments on commit 46df1ad

Please sign in to comment.