diff --git a/galaxy_ng/app/api/v1/viewsets/roles.py b/galaxy_ng/app/api/v1/viewsets/roles.py index d339c2d193..ebf227a9e1 100644 --- a/galaxy_ng/app/api/v1/viewsets/roles.py +++ b/galaxy_ng/app/api/v1/viewsets/roles.py @@ -111,7 +111,6 @@ def update(self, request, pk=None): changed['repository'] = {} role.full_metadata['repository'] = {} for subkey, subval in newval.items(): - print(f'{key}.{subkey} {role.full_metadata[key].get(subkey)} --> {subval}') if role.full_metadata.get(key, {}).get(subkey) != subval: if key not in changed: changed[key] = {} @@ -119,6 +118,15 @@ def update(self, request, pk=None): changed[key][subkey] = subval continue + # github_repo should set repository.name? + if key == 'github_repo': + if not role.full_metadata.get('repository'): + changed['repository'] = {} + role.full_metadata['repository'] = {} + old_name = role.full_metadata['repository'].get('name') + role.full_metadata['repository']['name'] = newval + role.full_metadata['repository']['original_name'] = old_name + if role.full_metadata.get(key) != newval: role.full_metadata[key] = newval changed[key] = newval