api: export/import, add uuid for role in dependencies view (#82764)
gitea/chrono/pipeline/head This commit looks good Details

This commit is contained in:
Lauréline Guérin 2023-10-24 15:26:02 +02:00 committed by Lauréline Guérin
parent 9defbefe1e
commit a940ee3961
2 changed files with 5 additions and 2 deletions

View File

@ -108,6 +108,9 @@ class AgendaDependencies(GenericAPIView):
'text': element.name,
'type': 'roles',
'urls': {},
# include uuid in object reference, this is not used for applification API but is useful
# for authentic creating its role summary page.
'uuid': element.role.uuid if hasattr(element, 'role') else None,
}
elif isinstance(element, Agenda):
return get_agenda_bundle_entry(request, element, 0)

View File

@ -82,8 +82,8 @@ def test_agenda_dependencies_groups(app, user):
# not group id
assert resp.json == {
'data': [
{'id': group2.id, 'text': group2.name, 'type': 'roles', 'urls': {}},
{'id': group1.id, 'text': group1.name, 'type': 'roles', 'urls': {}},
{'id': group2.id, 'text': group2.name, 'type': 'roles', 'urls': {}, 'uuid': None},
{'id': group1.id, 'text': group1.name, 'type': 'roles', 'urls': {}, 'uuid': None},
],
'err': 0,
}