Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ dist/*.tar.gz
/.mypy_cache
/.coverage
/htmlcov
*.sublime-project
*.sublime-workspace
7 changes: 4 additions & 3 deletions tvdb_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def __repr__(self):
return "<Actor %r>" % self.get("name")


def create_key(self, request):
def create_key(self, request, **kwargs):
"""A new cache_key algo is required as the authentication token
changes with each run. Also there are other header params which
also change with each request (e.g. timestamp). Excluding all
Expand All @@ -544,7 +544,8 @@ def create_key(self, request):
cache is to be used thus saving host and network traffic.
"""

if self._ignored_parameters:
# Use 'ignored_parameters' if present (instead of _ignored_parameters) #balls
if getattr(self, 'ignored_parameters', None):
url, body = self._remove_ignored_parameters(request)
else:
url, body = request.url, request.body
Expand All @@ -554,7 +555,7 @@ def create_key(self, request):
if request.body:
key.update(_to_bytes(body))
else:
if self._include_get_headers and request.headers != _DEFAULT_HEADERS:
if getattr(self, '_include_get_headers', False) and request.headers != _DEFAULT_HEADERS:
for name, value in sorted(request.headers.items()):
# include only Accept-Language as it is important for context
if name in ['Accept-Language']:
Expand Down