Skip to content

Commit 5c1533a

Browse files
Refactors conversation type argument naming for clarity
Updates parameter names from 'type' to 'type_' in conversation-related functions to avoid shadowing built-in names and improve code readability.
1 parent 460a21a commit 5c1533a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

services/web/server/src/simcore_service_webserver/conversations/_conversation_repository.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ async def get_for_user(
242242
*,
243243
conversation_id: ConversationID,
244244
user_group_id: GroupID,
245-
type: ConversationType | None = None,
245+
type_: ConversationType | None = None,
246246
) -> ConversationGetDB:
247247
select_query = (
248248
select(*_SELECTION_ARGS)
@@ -253,8 +253,8 @@ async def get_for_user(
253253
)
254254
)
255255

256-
if type is not None:
257-
select_query = select_query.where(conversations.c.type == type)
256+
if type_ is not None:
257+
select_query = select_query.where(conversations.c.type == type_)
258258

259259
async with pass_or_acquire_connection(get_asyncpg_engine(app), connection) as conn:
260260
result = await conn.execute(select_query)

services/web/server/src/simcore_service_webserver/conversations/_conversation_service.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ async def get_conversation(
8181
*,
8282
conversation_id: ConversationID,
8383
# filters
84-
type: ConversationType | None = None,
84+
type_: ConversationType | None = None,
8585
) -> ConversationGetDB:
8686
return await _conversation_repository.get(
8787
app,
8888
conversation_id=conversation_id,
89-
type=type,
89+
type=type_,
9090
)
9191

9292

@@ -95,13 +95,13 @@ async def get_conversation_for_user(
9595
*,
9696
conversation_id: ConversationID,
9797
user_group_id: UserID,
98-
type: ConversationType | None = None,
98+
type_: ConversationType | None = None,
9999
) -> ConversationGetDB:
100100
return await _conversation_repository.get_for_user(
101101
app,
102102
conversation_id=conversation_id,
103103
user_group_id=user_group_id,
104-
type=type,
104+
type_=type_,
105105
)
106106

107107

@@ -190,15 +190,15 @@ async def get_support_conversation_for_user(
190190
if _support_standard_group_id in _user_group_ids:
191191
# I am a support user
192192
return await get_conversation(
193-
app, conversation_id=conversation_id, type=ConversationType.SUPPORT
193+
app, conversation_id=conversation_id, type_=ConversationType.SUPPORT
194194
)
195195

196196
_user_group_id = await users_service.get_user_primary_group_id(app, user_id=user_id)
197197
return await get_conversation_for_user(
198198
app,
199199
conversation_id=conversation_id,
200200
user_group_id=_user_group_id,
201-
type=ConversationType.SUPPORT,
201+
type_=ConversationType.SUPPORT,
202202
)
203203

204204

0 commit comments

Comments
 (0)