Commit 0a68925e authored by Michal Čihař's avatar Michal Čihař

Add delete flag to IndexUpdate to offload deleting as well

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent a6b1f69a
......@@ -47,7 +47,7 @@ class Command(BaseCommand):
# Grab all updates from the database
with transaction.atomic():
updates = IndexUpdate.objects.all()
updates = IndexUpdate.objects.filter(to_delete=False)
for update in updates[:options['limit']].iterator():
indexupdates.add(update.pk)
unit_ids.add(update.unit_id)
......
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-02 11:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('trans', '0052_install_group_acl'),
]
operations = [
migrations.AddField(
model_name='indexupdate',
name='to_delete',
field=models.BooleanField(default=False),
),
]
......@@ -26,6 +26,7 @@ from django.utils.encoding import force_text, python_2_unicode_compatible
class IndexUpdate(models.Model):
unit = models.OneToOneField('Unit')
source = models.BooleanField(default=True)
to_delete = models.BooleanField(default=False)
class Meta(object):
app_label = 'trans'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment