Skip to content

Commit

Permalink
Merge pull request #226 from siteshwar/github-224
Browse files Browse the repository at this point in the history
hub: `worker` field in Task table should not be cascade
  • Loading branch information
rohanpm authored Sep 4, 2023
2 parents 3d57ecb + ea80e34 commit cc6e611
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions kobo/hub/migrations/0004_alter_task_worker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.0.10 on 2023-08-30 08:41

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


class Migration(migrations.Migration):

dependencies = [
('hub', '0003_auto_20160202_0647'),
]

operations = [
migrations.AlterField(
model_name='task',
name='worker',
field=models.ForeignKey(blank=True, help_text='A worker which has this task assigned.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='hub.worker'),
),
]
2 changes: 1 addition & 1 deletion kobo/hub/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class Task(models.Model):
"""Model for hub_task table."""
archive = models.BooleanField(default=False, help_text=_("When a task is archived, it disappears from admin interface and cannot be accessed by taskd.<br />Make sure that archived tasks are finished and you won't need them anymore."))
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
worker = models.ForeignKey(Worker, null=True, blank=True, help_text=_("A worker which has this task assigned."), on_delete=models.CASCADE)
worker = models.ForeignKey(Worker, null=True, blank=True, help_text=_("A worker which has this task assigned."), on_delete=models.SET_NULL)
parent = models.ForeignKey("self", null=True, blank=True, help_text=_("Parent task."), on_delete=models.CASCADE)
state = models.PositiveIntegerField(default=TASK_STATES["FREE"], choices=TASK_STATES.get_mapping(), help_text=_("Current task state."))
label = models.CharField(max_length=255, blank=True, help_text=_("Label, description or any reason for this task."))
Expand Down

0 comments on commit cc6e611

Please sign in to comment.