Skip to content

Commit

Permalink
Resolved purge vs export conflict
Browse files Browse the repository at this point in the history
When there was a completed export in the task list, task purge
would fail as the task could not be deleted because of a dependency
to a linked object. This issue has been resolved.

fixes: pulp#3741
  • Loading branch information
MichalPysik committed Apr 19, 2023
1 parent ffcd321 commit 08a2c3b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/3741.bugfix
@@ -0,0 +1 @@
Fixed issue with deleting export tasks via purge.
19 changes: 19 additions & 0 deletions pulpcore/app/migrations/0103_alter_export_task.py
@@ -0,0 +1,19 @@
# Generated by Django 3.2.18 on 2023-04-04 16:30

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('core', '0102_add_domain_relations'),
]

operations = [
migrations.AlterField(
model_name='export',
name='task',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.task'),
),
]
2 changes: 1 addition & 1 deletion pulpcore/app/models/exporter.py
Expand Up @@ -27,7 +27,7 @@ class Export(BaseModel):
"""

params = models.JSONField(null=True)
task = models.ForeignKey("Task", on_delete=models.PROTECT, null=True)
task = models.ForeignKey("Task", on_delete=models.SET_NULL, null=True)
exporter = models.ForeignKey("Exporter", on_delete=models.CASCADE)


Expand Down

0 comments on commit 08a2c3b

Please sign in to comment.