diff --git a/inventory-app/inventory.py b/inventory-app/inventory.py index f3b35b5..d37b00a 100644 --- a/inventory-app/inventory.py +++ b/inventory-app/inventory.py @@ -24,6 +24,7 @@ def view_inventory_view(item_id): user = read_user() template = "inventory_view.html" item = db.inventory.find_one({ "_id": ObjectId(item_id) }) + item_user = item.get("inventory", {}).get("user", {}).get("username", None) if not user: if not item["inventory"].get("public"): return do_login() @@ -31,6 +32,7 @@ def view_inventory_view(item_id): else: can_audit = "k-space:janitors" in user["groups"] can_edit = check_edit_permission(item_id) + is_using = item_user and item_user == user["username"] bucket=get_bucket() photo_url = bucket.generate_presigned_url( ClientMethod='get_object', diff --git a/inventory-app/templates/inventory_view.html b/inventory-app/templates/inventory_view.html index b0c8f67..82e1008 100644 --- a/inventory-app/templates/inventory_view.html +++ b/inventory-app/templates/inventory_view.html @@ -150,6 +150,16 @@ {% endif %} +{% if is_using %} +
+
+
+ +
+
+
+{% endif %} +