Skip to content

Commit

Permalink
Merge pull request #1489 from ianballou/patch-1
Browse files Browse the repository at this point in the history
Add transaction.atomic for Modulemd content
  • Loading branch information
goosemania committed Nov 5, 2019
2 parents 95702df + c578e8f commit 789fc83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/5663.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added transaction.atomic for syncing Modulemd content
3 changes: 2 additions & 1 deletion pulp_rpm/app/tasks/synchronizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,8 @@ def _handle_distribution_tree(declarative_content):
elif isinstance(declarative_content.content, Modulemd):
for pkg in declarative_content.extra_data['package_relation']:
try:
declarative_content.content.packages.add(pkg.content)
with transaction.atomic():
declarative_content.content.packages.add(pkg.content)
except ValueError:
pass

Expand Down

0 comments on commit 789fc83

Please sign in to comment.