Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed Sep 28, 2017
1 parent 870c37b commit 8ab89a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sc/social/like/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
zcml:condition="installed plone.app.contenttypes"
for="plone.dexterity.interfaces.IDexterityContent
Products.DCWorkflow.interfaces.IAfterTransitionEvent"
handler=".subscribers.prefetch_facebook"
handler=".subscribers.facebook_prefetching"
/>

<subscriber
zcml:condition="installed plone.app.contenttypes"
for="plone.dexterity.interfaces.IDexterityContent
plone.dexterity.interfaces.IEditFinishedEvent"
handler=".subscribers.prefetch_facebook"
handler=".subscribers.facebook_prefetching"
/>

<include file="behaviors.zcml" />
Expand Down
6 changes: 4 additions & 2 deletions sc/social/like/subscribers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ def check_sharing_best_practices(obj, event):
api.portal.show_message(message=e.message, request=request, type='warning')


def prefetch_facebook(obj, event):
"""Prefetching in object if enable."""
def facebook_prefetching(obj, event):
"""Call Facebook Graph API endpoint to keep metadata of published
objects always updated.
"""
record = ISocialLikeSettings.__identifier__ + '.facebook_prefetch_enabled'
prefetch_enable = api.portal.get_registry_record(record, default=False)
if not prefetch_enable:
Expand Down

0 comments on commit 8ab89a3

Please sign in to comment.