From a756dfdcd790b713230eb87b19207ec0f52b9a48 Mon Sep 17 00:00:00 2001 From: sujanadh Date: Wed, 6 Dec 2023 10:41:26 +0545 Subject: [PATCH] fix: retriving field value directly using model object --- src/backend/app/tasks/tasks_schemas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/app/tasks/tasks_schemas.py b/src/backend/app/tasks/tasks_schemas.py index 74548f7de8..bde911e32b 100644 --- a/src/backend/app/tasks/tasks_schemas.py +++ b/src/backend/app/tasks/tasks_schemas.py @@ -103,7 +103,7 @@ def get_centroid_from_outline(cls, v: Any, info: ValidationInfo) -> str: def get_lock_uid(cls, v: int, info: ValidationInfo) -> str: """Get lock uid from lock_holder details.""" if lock_holder := info.data.get("lock_holder"): - return lock_holder.get("id") + return lock_holder.id return None @field_validator("locked_by_username", mode="before") @@ -111,7 +111,7 @@ def get_lock_uid(cls, v: int, info: ValidationInfo) -> str: def get_lock_username(cls, v: str, info: ValidationInfo) -> str: """Get lock username from lock_holder details.""" if lock_holder := info.data.get("lock_holder"): - return lock_holder.get("username") + return lock_holder.username return None