|
42 | 42 |
|
43 | 43 | _GROUPS_API_SC = "users/groups" |
44 | 44 |
|
45 | | -SETTABLE_PROPERTIES = ("login", "name", "scmAccounts", "email", "groups", "local") |
| 45 | +SETTABLE_PROPERTIES = ("login", "name", "email", "groups", "scmAccounts", "local") |
46 | 46 | USER_API = "v2/users-management/users" |
47 | 47 |
|
48 | 48 |
|
@@ -448,7 +448,8 @@ def to_json(self, export_settings: types.ConfigSettings) -> types.ObjectJsonRepr |
448 | 448 | json_data.pop("local") |
449 | 449 | for key in "sonarQubeLastConnectionDate", "externalLogin", "externalProvider", "id", "managed": |
450 | 450 | json_data.pop(key, None) |
451 | | - return util.filter_export(json_data, SETTABLE_PROPERTIES, export_settings.get("FULL_EXPORT", False)) |
| 451 | + json_data = util.filter_export(json_data, SETTABLE_PROPERTIES, export_settings.get("FULL_EXPORT", False)) |
| 452 | + return convert_user_json(json_data) |
452 | 453 |
|
453 | 454 |
|
454 | 455 | def search(endpoint: pf.Platform, params: types.ApiParams = None) -> dict[str, User]: |
@@ -571,7 +572,10 @@ def exists(endpoint: pf.Platform, login: str) -> bool: |
571 | 572 |
|
572 | 573 |
|
573 | 574 | def convert_user_json(old_json: dict[str, Any]) -> dict[str, Any]: |
574 | | - return util.order_dict(old_json, ["name", "email", "groups", "scmAccounts", "local"]) |
| 575 | + for k in "groups", "scmAccounts": |
| 576 | + if k in old_json: |
| 577 | + old_json[k] = util.csv_to_list(old_json[k]) |
| 578 | + return util.order_dict(old_json, SETTABLE_PROPERTIES) |
575 | 579 |
|
576 | 580 |
|
577 | 581 | def convert_users_json(old_json: dict[str, Any]) -> dict[str, Any]: |
|
0 commit comments