Skip to content

Commit 6b9d7fa

Browse files
fix deprecated json()
1 parent a50f41a commit 6b9d7fa

37 files changed

+56
-46
lines changed

services/web/server/src/simcore_service_webserver/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ async def app_factory() -> web.Application:
6767
assert app_settings.SC_BUILD_TARGET # nosec
6868

6969
_logger.info(
70-
"Application settings: %s", app_settings.json(indent=2, sort_keys=True)
70+
"Application settings: %s",
71+
app_settings.model_dump_json(indent=2, sort_keys=True),
7172
)
7273

7374
app, _ = _setup_app_from_settings(app_settings)

services/web/server/src/simcore_service_webserver/email/_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def _do_send_mail(
3636
WARNING: _do_send_mail is mocked so be careful when changing the signature or name !!
3737
"""
3838

39-
_logger.debug("Email configuration %s", settings.json(indent=1))
39+
_logger.debug("Email configuration %s", settings.model_dump_json(indeent=1))
4040

4141
if settings.SMTP_PORT == 587:
4242
# NOTE: aiosmtplib does not handle port 587 correctly this is a workaround

services/web/server/src/simcore_service_webserver/email/_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async def test_email(request: web.Request):
111111
except Exception as err: # pylint: disable=broad-except
112112
logger.exception(
113113
"test_email failed for %s",
114-
f"{settings.json(indent=1)}",
114+
f"{settings.model_dump_json(indent=1)}",
115115
)
116116
return envelope_json_response(
117117
EmailTestFailed.create_from_exception(error=err, test_name="test_email")

services/web/server/src/simcore_service_webserver/folders/_folders_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ async def list_folders(request: web.Request):
183183
)
184184
)
185185
return web.Response(
186-
text=page.json(**RESPONSE_MODEL_POLICY),
186+
text=page.model_dump_json(**RESPONSE_MODEL_POLICY),
187187
content_type=MIMETYPE_APPLICATION_JSON,
188188
)
189189

services/web/server/src/simcore_service_webserver/login/_registration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ async def check_and_consume_invitation(
286286
)
287287

288288
_logger.info(
289-
"Consuming invitation from service:\n%s", content.json(indent=1)
289+
"Consuming invitation from service:\n%s",
290+
content.model_dump_json(indent=1),
290291
)
291292
return InvitationData(
292293
issuer=content.issuer,

services/web/server/src/simcore_service_webserver/meta_modeling/_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ async def list_project_iterations(request: web.Request) -> web.Response:
302302
)
303303
)
304304
return web.Response(
305-
text=page.json(**RESPONSE_MODEL_POLICY),
305+
text=page.model_dump_json(**RESPONSE_MODEL_POLICY),
306306
content_type="application/json",
307307
)
308308

@@ -405,6 +405,6 @@ def _get_project_results(project_id) -> ExtractedResults:
405405
)
406406
)
407407
return web.Response(
408-
text=page.json(**RESPONSE_MODEL_POLICY),
408+
text=page.model_dump_json(**RESPONSE_MODEL_POLICY),
409409
content_type="application/json",
410410
)

services/web/server/src/simcore_service_webserver/projects/_comments_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ async def list_project_comments(request: web.Request):
157157
)
158158
)
159159
return web.Response(
160-
text=page.json(**RESPONSE_MODEL_POLICY),
160+
text=page.model_dump_json(**RESPONSE_MODEL_POLICY),
161161
content_type=MIMETYPE_APPLICATION_JSON,
162162
)
163163

services/web/server/src/simcore_service_webserver/projects/_crud_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ async def list_projects(request: web.Request):
226226
)
227227
)
228228
return web.Response(
229-
text=page.json(**RESPONSE_MODEL_POLICY),
229+
text=page.model_dump_json(**RESPONSE_MODEL_POLICY),
230230
content_type=MIMETYPE_APPLICATION_JSON,
231231
)
232232

@@ -265,7 +265,7 @@ async def list_projects_full_search(request: web.Request):
265265
)
266266
)
267267
return web.Response(
268-
text=page.json(**RESPONSE_MODEL_POLICY),
268+
text=page.model_dump_json(**RESPONSE_MODEL_POLICY),
269269
content_type=MIMETYPE_APPLICATION_JSON,
270270
)
271271

services/web/server/src/simcore_service_webserver/projects/_nodes_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ async def get_node_screenshots(
239239
except (KeyError, ValidationError, ClientError) as err:
240240
_logger.warning(
241241
"Skipping fake node. Unable to create link from file-picker %s: %s",
242-
node.json(indent=1),
242+
node.model_dump_json(indent=1),
243243
err,
244244
)
245245

services/web/server/src/simcore_service_webserver/projects/projects_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ async def add_project_states_for_user(
14901490
if prj_node is None:
14911491
continue
14921492
node_state_dict = json.loads(
1493-
node_state.json(by_alias=True, exclude_unset=True)
1493+
node_state.model_dump_json(by_alias=True, exclude_unset=True)
14941494
)
14951495
prj_node.setdefault("state", {}).update(node_state_dict)
14961496
prj_node_progress = node_state_dict.get("progress", None) or 0

0 commit comments

Comments
 (0)