-
Bug
-
Resolution: Done
-
Critical
-
2.3
-
None
-
False
-
-
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()