Skip to content

Commit

Permalink
honour the use_request argument to the make_cache_key function
Browse files Browse the repository at this point in the history
This is technically a breaking API change, although a very small one, it
will have to be decided if that's okay.
  • Loading branch information
buckley-w-david committed Jan 29, 2020
1 parent 0ae838a commit 8880c10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flask_caching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def decorated_function(*args, **kwargs):
)
return rv

def make_cache_key(*args, **kwargs):
def make_cache_key(*args, use_request=False, **kwargs):
# Convert non-keyword arguments (which is the way
# `make_cache_key` expects them) to keyword arguments
# (the way `url_for` expects them)
Expand All @@ -456,7 +456,7 @@ def make_cache_key(*args, **kwargs):
for arg_name, arg in zip(argspec_args, args):
kwargs[arg_name] = arg

return _make_cache_key(args, kwargs, use_request=False)
return _make_cache_key(args, kwargs, use_request=use_request)

def _make_cache_key_query_string():
"""Create consistent keys for query string arguments.
Expand Down

0 comments on commit 8880c10

Please sign in to comment.