Store into cache using instance.id instead of requested id.
This helps ensure that the keys of the cache are the true and correct data type and not just whatever the user provided. SQLite coerces strings and ints.
This commit is contained in:
parent
c7f4d1dbf9
commit
d17a79c128
1 changed files with 1 additions and 1 deletions
|
@ -455,7 +455,7 @@ class DatabaseWithCaching(Database, metaclass=abc.ABCMeta):
|
|||
instance = object_class(self, object_row)
|
||||
|
||||
if object_cache is not None:
|
||||
object_cache[object_id] = instance
|
||||
object_cache[instance.id] = instance
|
||||
|
||||
return instance
|
||||
|
||||
|
|
Loading…
Reference in a new issue