0.3.13.3
This commit is contained in:
parent
0241de95cd
commit
e008d2f53c
4 changed files with 17 additions and 5 deletions
|
|
@ -11,6 +11,7 @@ from django.utils.html import format_html, urlize
|
|||
from django.utils.translation import ugettext as _
|
||||
|
||||
import pytz
|
||||
import sentry_sdk
|
||||
|
||||
from ftfy import fix_text
|
||||
from requests_oauthlib import OAuth1 as OAuth
|
||||
|
|
@ -234,11 +235,18 @@ class TwitterClient(PostClient):
|
|||
|
||||
break
|
||||
except StreamDeniedException as e:
|
||||
logger.exception(
|
||||
f"Access token expired for user {stream.rule.user.pk}",
|
||||
extra={"content": e.response.content} if e.response else {},
|
||||
logger.warning(
|
||||
f"Access token expired for user {stream.rule.user.pk}"
|
||||
)
|
||||
|
||||
with sentry_sdk.push_scope() as scope:
|
||||
if e.response:
|
||||
scope.set_extra("content", e.response.content)
|
||||
|
||||
sentry_sdk.capture_message(
|
||||
"Twitter authentication credentials reset"
|
||||
)
|
||||
|
||||
stream.rule.user.twitter_oauth_token = None
|
||||
stream.rule.user.twitter_oauth_token_secret = None
|
||||
stream.rule.user.save()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue