Temporary hack so that cache sets are performed whenever save() is called,
regardless of commit flag. Without this, the file upload progress bar breaks because it gets a stale File object out of the cache. Eventually, it would be better if cache sets were only done condittionally based on commit flag, and also whenever Database.commit() is called.
This commit is contained in:
parent
50367579c0
commit
8fb1d9a80e
|
@ -72,8 +72,12 @@ class Database( object ):
|
|||
|
||||
if commit:
|
||||
connection.commit()
|
||||
if self.__cache:
|
||||
self.__cache.set( obj.cache_key, obj )
|
||||
|
||||
# FIXME: we shouldn't touch the cache unless there's actually a commit.
|
||||
# the problem is that in self.commit() below, we don't know which objects
|
||||
# to actually save into the cache
|
||||
if self.__cache:
|
||||
self.__cache.set( obj.cache_key, obj )
|
||||
|
||||
def commit( self ):
|
||||
self.__get_connection().commit()
|
||||
|
|
Reference in New Issue