Major overhaul to the Notes/Issues. Minor tweaks to the UI. Added Profile photos
This commit is contained in:
@@ -162,6 +162,7 @@ class DeviceUserInfo(BaseModel):
|
||||
display_name: str = ""
|
||||
email: str = ""
|
||||
role: str = ""
|
||||
photo_url: str = ""
|
||||
|
||||
|
||||
class DeviceUsersResponse(BaseModel):
|
||||
|
||||
@@ -191,6 +191,7 @@ def get_device_users(device_doc_id: str) -> list[dict]:
|
||||
user_id = ""
|
||||
display_name = ""
|
||||
email = ""
|
||||
photo_url = ""
|
||||
|
||||
if isinstance(user_ref, DocumentReference):
|
||||
try:
|
||||
@@ -200,6 +201,7 @@ def get_device_users(device_doc_id: str) -> list[dict]:
|
||||
user_id = user_doc.id
|
||||
display_name = user_data.get("display_name", "")
|
||||
email = user_data.get("email", "")
|
||||
photo_url = user_data.get("photo_url", "")
|
||||
except Exception as e:
|
||||
print(f"[devices] Error resolving user reference: {e}")
|
||||
continue
|
||||
@@ -212,6 +214,7 @@ def get_device_users(device_doc_id: str) -> list[dict]:
|
||||
user_id = ref_doc.id
|
||||
display_name = user_data.get("display_name", "")
|
||||
email = user_data.get("email", "")
|
||||
photo_url = user_data.get("photo_url", "")
|
||||
except Exception as e:
|
||||
print(f"[devices] Error resolving user path: {e}")
|
||||
continue
|
||||
@@ -221,6 +224,7 @@ def get_device_users(device_doc_id: str) -> list[dict]:
|
||||
"display_name": display_name,
|
||||
"email": email,
|
||||
"role": role,
|
||||
"photo_url": photo_url,
|
||||
})
|
||||
else:
|
||||
# Fallback to user_list field
|
||||
@@ -246,6 +250,7 @@ def get_device_users(device_doc_id: str) -> list[dict]:
|
||||
"display_name": user_data.get("display_name", ""),
|
||||
"email": user_data.get("email", ""),
|
||||
"role": "",
|
||||
"photo_url": user_data.get("photo_url", ""),
|
||||
})
|
||||
except Exception as e:
|
||||
print(f"[devices] Error resolving user_list entry: {e}")
|
||||
|
||||
Reference in New Issue
Block a user