Uploaded image for project: 'Automation Hub'
  1. Automation Hub
  2. AAH-2038

Validated repo's distro missing content_guard

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 2.3, crc-2022-12-19
    • 2.3
    • Backend
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Approved

      Description

      The validated repo's distro is missing the content_guard and throws an error if you try to download from it

       

      Nov 18 18:44:56 ip-10-0-7-121 gunicorn[26351]:    return redirect(distribution.content_guard.cast().preauthenticate_url(url))
      Nov 18 18:44:56 ip-10-0-7-121 gunicorn[26351]: AttributeError: 'NoneType' object has no attribute 'cast'

       

      This distribution was created in a migration https://github.com/ansible/galaxy_ng/blob/master/galaxy_ng/app/migrations/0032_add_validated_repo.py#L6

       

      And it seems this did not get run when the distribution was created https://github.com/ansible/galaxy_ng/blob/67dbd314b2f49543c0a6e5c7b966187acfd72d43/galaxy_ng/app/signals/handlers.py#L27-L34

       

      Running this locally in `django-admin shell` allowed for a download from the UI:

      In [1]: content_guard = ContentRedirectContentGuard.objects.first()
      In [2]: distro = AnsibleDistribution.objects.get(name='validated')
      In [3]: distro.content_guard = content_guard
      In [4]: distro.save()

            awcrosby5 Andrew Crosby (Inactive)
            awcrosby5 Andrew Crosby (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: