mirror of https://github.com/zulip/zulip.git
Only render tweets if we have credentials
(imported from commit 46c59f430aeae87a832f33d2ccb85209f9caec74)
This commit is contained in:
parent
1b381b343d
commit
a2a1867f25
|
@ -82,6 +82,12 @@ def fetch_tweet_data(tweet_id):
|
||||||
import testing_mocks
|
import testing_mocks
|
||||||
res = testing_mocks.twitter(tweet_id)
|
res = testing_mocks.twitter(tweet_id)
|
||||||
else:
|
else:
|
||||||
|
if settings.TWITTER_CONSUMER_KEY == '' or \
|
||||||
|
settings.TWITTER_CONSUMER_SECRET == '' or \
|
||||||
|
settings.TWITTER_ACCESS_TOKEN_KEY == '' or \
|
||||||
|
settings.TWITTER_ACCESS_TOKEN_SECRET == '':
|
||||||
|
return None
|
||||||
|
|
||||||
api = twitter.Api(consumer_key = settings.TWITTER_CONSUMER_KEY,
|
api = twitter.Api(consumer_key = settings.TWITTER_CONSUMER_KEY,
|
||||||
consumer_secret = settings.TWITTER_CONSUMER_SECRET,
|
consumer_secret = settings.TWITTER_CONSUMER_SECRET,
|
||||||
access_token_key = settings.TWITTER_ACCESS_TOKEN_KEY,
|
access_token_key = settings.TWITTER_ACCESS_TOKEN_KEY,
|
||||||
|
|
Loading…
Reference in New Issue