Skip to content

Commit a421591

Browse files
committed
extra missing
1 parent 8e96ffc commit a421591

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

services/web/server/src/simcore_service_webserver/tags/_rest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ async def list_tag_groups(request: web.Request):
148148
caller_user_id=req_ctx.user_id,
149149
tag_id=path_params.tag_id,
150150
)
151-
return envelope_json_response([TagGroupGet.from_model(md) for md in got])
151+
return envelope_json_response([TagGroupGet.from_domain_model(md) for md in got])
152152

153153

154154
@routes.post(f"/{VTAG}/tags/{{tag_id}}/groups/{{group_id}}", name="create_tag_group")
@@ -165,11 +165,11 @@ async def create_tag_group(request: web.Request):
165165
caller_user_id=req_ctx.user_id,
166166
tag_id=path_params.tag_id,
167167
group_id=path_params.group_id,
168-
access_rights=body_params.to_model(),
168+
access_rights=body_params.to_domain_model(),
169169
)
170170

171171
return envelope_json_response(
172-
TagGroupGet.from_model(got), status_cls=web.HTTPCreated
172+
TagGroupGet.from_domain_model(got), status_cls=web.HTTPCreated
173173
)
174174

175175

@@ -187,10 +187,10 @@ async def replace_tag_group(request: web.Request):
187187
caller_user_id=req_ctx.user_id,
188188
tag_id=path_params.tag_id,
189189
group_id=path_params.group_id,
190-
access_rights=body_params.to_model(),
190+
access_rights=body_params.to_domain_model(),
191191
)
192192

193-
return envelope_json_response(TagGroupGet.from_model(got))
193+
return envelope_json_response(TagGroupGet.from_domain_model(got))
194194

195195

196196
@routes.delete(f"/{VTAG}/tags/{{tag_id}}/groups/{{group_id}}", name="delete_tag_group")

services/web/server/src/simcore_service_webserver/tags/_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def create_tag(
3535
delete=True,
3636
**new_tag.model_dump(exclude_unset=True),
3737
)
38-
return TagGet.from_model(tag)
38+
return TagGet.from_domain_model(tag)
3939

4040

4141
async def list_tags(
@@ -45,7 +45,7 @@ async def list_tags(
4545
engine: AsyncEngine = get_async_engine(app)
4646
repo = TagsRepo(engine)
4747
tags = await repo.list_all(user_id=user_id)
48-
return [TagGet.from_model(t) for t in tags]
48+
return [TagGet.from_domain_model(t) for t in tags]
4949

5050

5151
async def update_tag(
@@ -59,7 +59,7 @@ async def update_tag(
5959
tag_id=tag_id,
6060
**tag_updates.model_dump(exclude_unset=True),
6161
)
62-
return TagGet.from_model(tag)
62+
return TagGet.from_domain_model(tag)
6363

6464

6565
async def delete_tag(app: web.Application, user_id: UserID, tag_id: IdInt):

services/web/server/src/simcore_service_webserver/tags/schemas.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class TagGet(OutputSchema):
5555
access_rights: TagAccessRights = Field(..., alias="accessRights")
5656

5757
@classmethod
58-
def from_model(cls, tag: TagDict) -> Self:
58+
def from_domain_model(cls, tag: TagDict) -> Self:
5959
# NOTE: cls(access_rights=tag, **tag) would also work because of Config
6060
return cls(
6161
id=tag["id"],
@@ -84,7 +84,7 @@ class TagGroupCreate(InputSchema):
8484
write: bool
8585
delete: bool
8686

87-
def to_model(self) -> AccessRightsDict:
87+
def to_domain_model(self) -> AccessRightsDict:
8888
data = self.model_dump()
8989
return AccessRightsDict(
9090
read=data["read"],
@@ -101,7 +101,7 @@ class TagGroupGet(OutputSchema):
101101
delete: bool
102102

103103
@classmethod
104-
def from_model(cls, data: TagAccessRightsDict) -> Self:
104+
def from_domain_model(cls, data: TagAccessRightsDict) -> Self:
105105
return cls(
106106
gid=data["group_id"],
107107
read=data["read"],

0 commit comments

Comments
 (0)