Skip to content

Commit

Permalink
Fix call to Task.current()
Browse files Browse the repository at this point in the history
  • Loading branch information
David Davis authored and daviddavis committed Jan 2, 2020
1 parent 27fdebd commit 7c1aee6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/5894.bugfix
@@ -0,0 +1 @@
Fix bug where calling Repository new_version() outside of task raises exception.
2 changes: 1 addition & 1 deletion pulpcore/app/models/repository.py
Expand Up @@ -105,7 +105,7 @@ def new_version(self, base_version=None):
# now add any content that's in the base_version but not in version
version.add_content(base_version.content.exclude(pk__in=version.content))

if Task.current:
if Task.current():
resource = CreatedResource(content_object=version)
resource.save()
return version
Expand Down

0 comments on commit 7c1aee6

Please sign in to comment.