Skip to content

Commit 75be341

Browse files
committed
Quality pass
1 parent eb459a7 commit 75be341

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

sonar/portfolios.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ def to_json(self, export_settings: types.ConfigSettings) -> types.ObjectJsonRepr
369369
subportfolios = self.sub_portfolios()
370370
if not self.is_sub_portfolio():
371371
json_data["visibility"] = self._visibility
372-
if perms := self.permissions().export(export_settings=export_settings):
373-
json_data["permissions"] = util.perms_to_list(perms)
372+
if pf_perms := self.permissions().export(export_settings=export_settings):
373+
json_data["permissions"] = util.perms_to_list(pf_perms)
374374
json_data["tags"] = self._tags
375375
if subportfolios:
376376
json_data["portfolios"] = {}

sonar/users.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ def exists(endpoint: pf.Platform, login: str) -> bool:
572572

573573

574574
def convert_user_json(old_json: dict[str, Any]) -> dict[str, Any]:
575+
"""Converts a user JSON from old to new format"""
575576
for k in "groups", "scmAccounts":
576577
if k in old_json:
577578
old_json[k] = util.csv_to_list(old_json[k])

sonar/util/common_json_helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626

2727
def convert_common_fields(json_data: dict[str, Any], with_permissions: bool = True) -> dict[str, Any]:
28+
"""Converts Sonar objects common fields from old to new JSON format"""
2829
if "permissions" in json_data and json_data["permissions"] is None:
2930
json_data.pop("permissions")
3031
if with_permissions and "permissions" in json_data:

sonar/util/platform_helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def convert_basics_json(old_json: dict[str, Any]) -> dict[str, Any]:
4848

4949

5050
def convert_template_json(json_data: dict[str, Any], full: bool = False) -> dict[str, Any]:
51+
"""Converts a Perm Template JSON from old to new format"""
5152
json_data = common_json_helper.convert_common_fields(json_data)
5253
return util.remove_nones(util.filter_export(json_data, _PERM_TPL_IMPORTABLE_PROPERTIES, full))
5354

0 commit comments

Comments
 (0)