Revert "Remove unused methods"
[osm/LCM.git] / osm_lcm / data_utils / database / wim_account.py
index 8c958c1..a1f1799 100644 (file)
@@ -32,6 +32,16 @@ class WimAccountDB:
     def initialize_db(cls):
         cls.db = Database().instance.db
 
+    @classmethod
+    def get_wim_account_with_id(cls, wim_account_id):
+        if not cls.db:
+            cls.initialize_db()
+        if wim_account_id in cls.db_wims:
+            return cls.db_wims[wim_account_id]
+        db_wim = cls.db.get_one("wim_accounts", {"_id": wim_account_id}) or {}
+        cls.db_wims[wim_account_id] = db_wim
+        return db_wim
+
     @classmethod
     def get_all_wim_accounts(cls):
         if not cls.db: