Skip to content

Commit

Permalink
#3: fix handling empty fb_post_filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Dziedziul committed Jan 5, 2017
1 parent 2ef75f2 commit 08ffa9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions matterbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def check_posts(graph, config):
posts = graph.get_object(id=('%s/feed?fields=message,created_time,id&limit=1' % page_id))
last_post = posts[u'data'][0]
last_post_text = last_post.get('message', "").encode("utf8")
post_filter = integration.get('fb_post_filter').encode("utf8")
if post_filter is None or post_filter in last_post_text:
post_filter = integration.get('fb_post_filter')
if post_filter is None or post_filter.encode("utf8") in last_post_text:
if last_post == load_last_saved_post(integration_id):
log.debug("Old post: " + last_post_text)
else:
Expand Down

0 comments on commit 08ffa9d

Please sign in to comment.