mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-12 17:21:01 +00:00
Use == for comparison
This commit is contained in:
parent
f684b4e4e0
commit
a0c7b3f274
1 changed files with 3 additions and 3 deletions
|
|
@ -72,7 +72,7 @@ class CachedFileBackend(object):
|
|||
|
||||
def set_state(self, file, state):
|
||||
key = self.get_key(file)
|
||||
if state is CacheFileState.DOES_NOT_EXIST:
|
||||
if state == CacheFileState.DOES_NOT_EXIST:
|
||||
self.cache.set(key, state, self.existence_check_timeout)
|
||||
else:
|
||||
self.cache.set(key, state)
|
||||
|
|
@ -85,13 +85,13 @@ class CachedFileBackend(object):
|
|||
return state
|
||||
|
||||
def exists(self, file):
|
||||
return self.get_state(file) is CacheFileState.EXISTS
|
||||
return self.get_state(file) == CacheFileState.EXISTS
|
||||
|
||||
def generate(self, file, force=False):
|
||||
raise NotImplementedError
|
||||
|
||||
def generate_now(self, file, force=False):
|
||||
if force or self.get_state(file) is CacheFileState.DOES_NOT_EXIST:
|
||||
if force or self.get_state(file) == CacheFileState.DOES_NOT_EXIST:
|
||||
file._generate()
|
||||
self.set_state(file, CacheFileState.EXISTS)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue