From cf3605b7c0a86e799077f440e97645b22a69b8a0 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 5 May 2013 23:57:15 -0400 Subject: fixed a bug where twitter sharing button was shown, when twitter keys were not set up --- askbot/conf/social_sharing.py | 7 ++++++- askbot/templates/user_profile/user_info.html | 8 ++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/askbot/conf/social_sharing.py b/askbot/conf/social_sharing.py index e57dec28..392fa042 100644 --- a/askbot/conf/social_sharing.py +++ b/askbot/conf/social_sharing.py @@ -35,7 +35,12 @@ settings.register( SOCIAL_SHARING, 'ENABLE_SHARING_TWITTER', default=True, - description=_('Check to enable sharing of questions on Twitter') + description=_('Check to enable sharing of questions on Twitter'), + help_text=_( + 'Important - to actually start sharing on twitter, ' + 'it is required to set up Twitter consumer key and secret ' + 'in the "keys to external services" section.' + ) ) ) diff --git a/askbot/templates/user_profile/user_info.html b/askbot/templates/user_profile/user_info.html index 8f7a5006..95baad20 100644 --- a/askbot/templates/user_profile/user_info.html +++ b/askbot/templates/user_profile/user_info.html @@ -88,8 +88,12 @@ {{ macros.user_website_link(view_user, max_display_length = 30) }} {% endif %} - {% if request.user == view_user and settings.ENABLE_SHARING_TWITTER %} - {% include "user_profile/twitter_sharing_controls.html" %} + {% if request.user == view_user and + settings.TWITTER_SECRET and + settings.TWITTER_KEY and + settings.ENABLE_SHARING_TWITTER + %} + {% include "user_profile/twitter_sharing_controls.html" %} {% endif %} {% if view_user.location or view_user.country %} -- cgit v1.2.3-1-g7c22