File tree Expand file tree Collapse file tree 1 file changed +41
-6
lines changed
packages/postgres-database/src/simcore_postgres_database Expand file tree Collapse file tree 1 file changed +41
-6
lines changed Original file line number Diff line number Diff line change @@ -113,9 +113,17 @@ async def create(
113113 )
114114 result = await conn .execute (access_stmt )
115115 access = result .first ()
116- assert access
117-
118- return TagDict (** tag , ** access )
116+ assert access # nosec
117+
118+ return TagDict (
119+ id = tag .id ,
120+ name = tag .name ,
121+ description = tag .description ,
122+ color = tag .color ,
123+ read = access .read ,
124+ write = access .write ,
125+ delete = access .delete ,
126+ )
119127
120128 async def list_all (
121129 self ,
@@ -126,7 +134,18 @@ async def list_all(
126134 async with get_or_create_connection (self .engine , connection ) as conn :
127135 stmt_list = list_tags_stmt (user_id = user_id )
128136 result = await conn .stream (stmt_list )
129- return [TagDict (** row ) async for row in result ]
137+ return [
138+ TagDict (
139+ id = row .id ,
140+ name = row .name ,
141+ description = row .description ,
142+ color = row .color ,
143+ read = row .read ,
144+ write = row .write ,
145+ delete = row .delete ,
146+ )
147+ async for row in result
148+ ]
130149
131150 async def get (
132151 self ,
@@ -142,7 +161,15 @@ async def get(
142161 if not row :
143162 msg = f"{ tag_id = } not found: either no access or does not exists"
144163 raise TagNotFoundError (msg )
145- return TagDict (** row )
164+ return TagDict (
165+ id = row .id ,
166+ name = row .name ,
167+ description = row .description ,
168+ color = row .color ,
169+ read = row .read ,
170+ write = row .write ,
171+ delete = row .delete ,
172+ )
146173
147174 async def update (
148175 self ,
@@ -170,7 +197,15 @@ async def update(
170197 msg = f"{ tag_id = } not updated: either no access or not found"
171198 raise TagOperationNotAllowedError (msg )
172199
173- return TagDict (** row )
200+ return TagDict (
201+ id = row .id ,
202+ name = row .name ,
203+ description = row .description ,
204+ color = row .color ,
205+ read = row .read ,
206+ write = row .write ,
207+ delete = row .delete ,
208+ )
174209
175210 async def delete (
176211 self ,
You can’t perform that action at this time.
0 commit comments