Clean context before using it as a key for cache

This commit is contained in:
Cédric Krier committed 2009-08-07 19:45:03 +02:00
1 parent 27f67ccfd5
commit 2b866bfe7a
1 file changed
+6
+6
View File
@@ -280,6 +280,12 @@ class Cache(object):
return True
# Update named arguments with positional argument values
kwargs.update(dict(zip(arg_names, args)))
if 'context' in kwargs:
if isinstance(kwargs['context'], dict):
for i in ('_timestamp', '_delete', '_create_records',
'_delete_records'):
if i in kwargs['context']:
del kwargs['context'][i]
kwargs = kwargs.items()
kwargs.sort()