Skip to content

Commit

Permalink
Revert "Refactor."
Browse files Browse the repository at this point in the history
This reverts commit 6dfd360.
  • Loading branch information
jctanner committed Oct 9, 2023
1 parent 6dfd360 commit d5afdba
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions galaxy_ng/app/api/v1/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,18 @@ 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/{github_user}/{github_repo}'
clone_url = f'https://github.com/{ruser}/{github_repo}'
sfields = rdata.get('summary_fields', {})
role_tags = sfields.get('tags', [])
commit_hash = rdata.get('commit')
Expand All @@ -281,12 +286,11 @@ 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=role_name
name=rname
)
rmap[rkey] = this_role
else:
Expand Down

0 comments on commit d5afdba

Please sign in to comment.