Complete open my2dos tasks
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Generated by Django 5.2.17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def remove_unused_tags(apps, schema_editor):
|
||||
Tag = apps.get_model('core', 'Tag')
|
||||
Team = apps.get_model('core', 'Team')
|
||||
Tag.objects.filter(items__isnull=True, kanbans__isnull=True, api_keys__isnull=True).exclude(
|
||||
name__in=Team.objects.values_list('slug', flat=True),
|
||||
).delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0015_userpreference_due_first'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='userpreference',
|
||||
name='default_item_kind',
|
||||
field=models.CharField(
|
||||
choices=[('todo', 'Task'), ('note', 'Note'), ('link', 'Link'), ('journal', 'Journal')],
|
||||
default='note',
|
||||
max_length=10,
|
||||
),
|
||||
),
|
||||
migrations.RunPython(remove_unused_tags, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user