Skip to content

Commit

Permalink
Do not cast content guard to know its type
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Jul 12, 2022
1 parent 9a46463 commit 3dbce47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pulp_ansible/app/galaxy/v3/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,12 @@ def get(self, request, *args, **kwargs):
filename=self.kwargs["filename"],
)

if distribution.content_guard:
if (
distribution.content_guard
and distribution.content_guard.pulp_type == "core.content_redirect"
):
guard = distribution.content_guard.cast()
if guard.TYPE == "content_redirect":
return redirect(guard.preauthenticate_url(url))
return redirect(guard.preauthenticate_url(url))

return redirect(url)

Expand Down

0 comments on commit 3dbce47

Please sign in to comment.