home · contact · privacy
Refactor remaining test.utils helpers into actual tests.
[plomtask] / plomtask / db.py
index 797b08e8412809e3ac23bb7f04fc24fef955be03..cce2630cd58bfb8bf7283c2eb0d2f45006d8ba26 100644 (file)
@@ -337,9 +337,8 @@ class BaseModel(Generic[BaseModelId]):
     def _get_cached(cls: type[BaseModelInstance],
                     id_: BaseModelId) -> BaseModelInstance | None:
         """Get object of id_ from class's cache, or None if not found."""
-        # pylint: disable=consider-iterating-dictionary
         cache = cls.get_cache()
-        if id_ in cache.keys():
+        if id_ in cache:
             obj = cache[id_]
             assert isinstance(obj, cls)
             return obj