From 8ab89a3fce63115a2f46936caa29349fee524ba2 Mon Sep 17 00:00:00 2001 From: hvelarde Date: Thu, 28 Sep 2017 11:19:47 -0300 Subject: [PATCH] Code review --- sc/social/like/configure.zcml | 4 ++-- sc/social/like/subscribers.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sc/social/like/configure.zcml b/sc/social/like/configure.zcml index 728fa702..751e3899 100644 --- a/sc/social/like/configure.zcml +++ b/sc/social/like/configure.zcml @@ -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" /> diff --git a/sc/social/like/subscribers.py b/sc/social/like/subscribers.py index 3a21dea7..33b0503b 100644 --- a/sc/social/like/subscribers.py +++ b/sc/social/like/subscribers.py @@ -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: