Skip to content

Commit

Permalink
Refactor.
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Oct 9, 2023
1 parent a5cd615 commit 6dfd360
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions galaxy_ng/app/api/v1/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,13 @@ def legacy_sync_from_upstream(
else:
namespace, v3_namespace = nsmap[ns_data['name']]

ruser = rdata.get('github_user')
rname = rdata.get('name')

logger.info(f'POPULATE {ruser}.{rname}')

rkey = (ruser, rname)
remote_id = rdata['id']
role_name = rdata.get('name')
role_versions = rversions[:]
github_user = rdata['github_user']
github_repo = rdata['github_repo']
github_branch = rdata['github_branch']
clone_url = f'https://github.com/{ruser}/{github_repo}'
clone_url = f'https://github.com/{github_user}/{github_repo}'
sfields = rdata.get('summary_fields', {})
role_tags = sfields.get('tags', [])
commit_hash = rdata.get('commit')
Expand All @@ -286,11 +281,12 @@ def legacy_sync_from_upstream(
role_type = rdata.get('role_type', 'ANS')
role_download_count = rdata.get('download_count', 0)

rkey = (github_user, role_name)
if rkey not in rmap:
logger.debug(f'SYNC create initial role for {rkey}')
this_role, _ = LegacyRole.objects.get_or_create(
namespace=namespace,
name=rname
name=role_name
)
rmap[rkey] = this_role
else:
Expand Down

0 comments on commit 6dfd360

Please sign in to comment.