fix: preserve resolved flag when closing tickets
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def repair_closed_resolved_flags(apps, schema_editor):
|
||||
Ticket = apps.get_model("tickets", "Ticket")
|
||||
Ticket.objects.filter(
|
||||
status="closed",
|
||||
resolved_at__isnull=False,
|
||||
resolution_summary__gt="",
|
||||
is_resolved=False,
|
||||
).update(is_resolved=True)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("tickets", "0002_ticket_context_and_standard_categories"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(repair_closed_resolved_flags, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user