codacy
This commit is contained in:
parent
4f1fb8f262
commit
1b07bf1020
|
@ -5,7 +5,7 @@ from flask import make_response, abort
|
|||
import secrets
|
||||
import hmac
|
||||
import base64
|
||||
import pickle
|
||||
import pickle # nosec
|
||||
import re
|
||||
|
||||
|
||||
|
@ -109,7 +109,7 @@ class ImgProxyCache(object):
|
|||
body = self.redis.get(self.key('body', url))
|
||||
|
||||
try:
|
||||
headers = pickle.loads(headers)
|
||||
headers = pickle.loads(headers) # nosec
|
||||
except Exception as e:
|
||||
self.redis.delete(self.key('headers', url))
|
||||
headers = None
|
||||
|
|
|
@ -4,7 +4,6 @@ from mastodon.Mastodon import MastodonAPIError, MastodonNetworkError,\
|
|||
from model import MastodonApp, Account, OAuthToken, Post
|
||||
from requests import head
|
||||
from app import db, sentry
|
||||
from math import inf
|
||||
from libforget.exceptions import TemporaryError
|
||||
from functools import lru_cache
|
||||
|
||||
|
@ -84,7 +83,7 @@ def get_api_for_acc(account):
|
|||
# doesnt error even if the token is revoked lol
|
||||
# https://github.com/tootsuite/mastodon/issues/4637
|
||||
# so we have to do this:
|
||||
tl = api.timeline()
|
||||
api.timeline()
|
||||
return api
|
||||
except MastodonAPIError as e:
|
||||
if 'token' in str(e):
|
||||
|
|
Loading…
Reference in New Issue