Skip to content

Commit

Permalink
Fix repositories deletion failure when using ansible-galaxy client
Browse files Browse the repository at this point in the history
ansible-galaxy client uses deprecated API to delete user repositories.
This patch fixes reporisotry and roles lookup performed by `name`
attribute instead of `original_name`.
  • Loading branch information
cutwater committed Dec 14, 2018
1 parent 4b466d4 commit d25f2d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions galaxy/api/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def delete(self, request, *args, **kwargs):

roles = models.Content.objects.filter(
repository__provider_namespace__name=gh_user,
repository__name=gh_repo)
repository__original_name=gh_repo)
cnt = len(roles)
if cnt == 0:
response['status'] = (
Expand All @@ -949,7 +949,7 @@ def delete(self, request, *args, **kwargs):

repo = models.Repository.objects.get(
provider_namespace__name=gh_user,
name=gh_repo)
original_name=gh_repo)

models.Notification.objects.filter(repository=repo).delete()
models.Content.objects.filter(repository=repo).delete()
Expand Down

0 comments on commit d25f2d6

Please sign in to comment.