Skip to content

Commit 9ffa4c6

Browse files
committed
fixes pylint
1 parent fc51ade commit 9ffa4c6

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def _enable_only_if_dev_features_allowed(cls, v, info: ValidationInfo):
411411

412412
return (
413413
None
414-
if info.field_name and is_nullable(cls.model_fields[info.field_name])
414+
if info.field_name and is_nullable(dict(cls.model_fields)[info.field_name])
415415
else False
416416
)
417417

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def convert_to_environ_vars( # noqa: C901, PLR0915, PLR0912
202202
def _set_if_disabled(field_name, section):
203203
# Assumes that by default is enabled
204204
enabled = section.get("enabled", True)
205-
field = ApplicationSettings.model_fields[field_name]
205+
field = dict(ApplicationSettings.model_fields)[field_name]
206206
if not enabled:
207207
envs[field_name] = "null" if is_nullable(field) else "0"
208208
elif get_type(field) == bool:

services/web/server/tests/unit/isolated/test_users_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_auto_compute_gravatar__deprecated(fake_profile_get: MyProfileGet):
8989

9090
assert (
9191
"gravatar_id" not in data
92-
), f"{MyProfileGet.model_fields['gravatar_id'].deprecated=}"
92+
), f"{dict(MyProfileGet.model_fields)['gravatar_id'].deprecated=}"
9393
assert data["id"] == profile.id
9494
assert data["first_name"] == profile.first_name
9595
assert data["last_name"] == profile.last_name

services/web/server/tests/unit/with_dbs/04/licenses/test_licensed_items_repository.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,16 @@ async def test_licensed_items_db_trash(
114114
)
115115
licensed_item_ids.append(licensed_item_db.licensed_item_id)
116116

117-
licensed_item_id1, licensed_item_id2 = licensed_item_ids
118-
119117
# Trash one licensed item
120118
trashing_at = arrow.now().datetime
121119
trashed_item = await _licensed_items_repository.update(
122120
client.app,
123-
licensed_item_id=licensed_item_id1,
121+
licensed_item_id=licensed_item_ids[0],
124122
product_name=osparc_product_name,
125123
updates=LicensedItemUpdateDB(trash=True),
126124
)
127125

128-
assert trashed_item.licensed_item_id == licensed_item_id1
126+
assert trashed_item.licensed_item_id == licensed_item_ids[0]
129127
assert trashed_item.trashed
130128
assert trashing_at < trashed_item.trashed
131129
assert trashed_item.trashed < arrow.now().datetime
@@ -152,7 +150,7 @@ async def test_licensed_items_db_trash(
152150
trashed="exclude",
153151
)
154152
assert total_count == 1
155-
assert items[0].licensed_item_id == licensed_item_id2
153+
assert items[0].licensed_item_id == licensed_item_ids[1]
156154
assert items[0].trashed is None
157155

158156
# List with filter_trashed all

services/web/server/tests/unit/with_dbs/04/wallets/payments/test_payments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ async def test_payment_not_found(
362362

363363

364364
def test_payment_transaction_state_and_literals_are_in_sync():
365-
state_literals = PaymentTransaction.model_fields["state"].annotation
365+
state_literals = dict(PaymentTransaction.model_fields)["state"].annotation
366366
assert (
367367
TypeAdapter(list[state_literals]).validate_python(
368368
[f"{s}" for s in PaymentTransactionState]

0 commit comments

Comments
 (0)