diff --git a/django/core/cache/backends/redis.py b/django/core/cache/backends/redis.py index 99cdd594ca..cb55be71c2 100644 --- a/django/core/cache/backends/redis.py +++ b/django/core/cache/backends/redis.py @@ -222,10 +222,7 @@ class RedisCache(BaseCache): return [] def delete_many(self, keys, version=None): - safe_keys = [] - for key in keys: - key = self.make_and_validate_key(key, version=version) - safe_keys.append(key) + safe_keys = [self.make_and_validate_key(key, version=version) for key in keys] self._cache.delete_many(safe_keys) def clear(self):