[odrs-web] Fetch component for compat IDs



commit 5085b96f22093acf1dbb476b91dd88464b729206
Author: Bartłomiej Piotrowski <b bpiotrowski pl>
Date:   Thu Sep 1 12:12:43 2022 +0200

    Fetch component for compat IDs

 odrs/views_api.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/odrs/views_api.py b/odrs/views_api.py
index ba7a23e..7c65114 100644
--- a/odrs/views_api.py
+++ b/odrs/views_api.py
@@ -252,6 +252,12 @@ def api_fetch():
     if not len(request_item["user_hash"]) == 40:
         return json_error("the user_hash is invalid")
 
+    component = (
+        db.session.query(Component)
+        .filter(Component.app_id == request_item["app_id"])
+        .first()
+    )
+
     # also add any compat IDs
     app_ids = [request_item["app_id"]]
     if "compat_ids" in request_item:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]