From e9a2313d93561895923180b48b97adbcaada6862 Mon Sep 17 00:00:00 2001 From: Arkadiy Korotaev Date: Tue, 10 Nov 2020 18:24:16 +0100 Subject: [PATCH] fix(migrations): Rename the migration back due to InconsistentMigrationHistory otherwise --- ...018_fix_migrations.py => 0018_ticket_secret_key.py} | 0 helpdesk/migrations/0019_ticket_secret_key.py | 10 ++++++---- 2 files changed, 6 insertions(+), 4 deletions(-) rename helpdesk/migrations/{0018_fix_migrations.py => 0018_ticket_secret_key.py} (100%) diff --git a/helpdesk/migrations/0018_fix_migrations.py b/helpdesk/migrations/0018_ticket_secret_key.py similarity index 100% rename from helpdesk/migrations/0018_fix_migrations.py rename to helpdesk/migrations/0018_ticket_secret_key.py diff --git a/helpdesk/migrations/0019_ticket_secret_key.py b/helpdesk/migrations/0019_ticket_secret_key.py index 8586e00e..47f10571 100644 --- a/helpdesk/migrations/0019_ticket_secret_key.py +++ b/helpdesk/migrations/0019_ticket_secret_key.py @@ -8,20 +8,22 @@ def clear_secret_keys(apps, schema_editor): db_alias = schema_editor.connection.alias for ticket in Ticket.objects.using(db_alias).all(): - ticket.secret_key='' - ticket.save() + ticket.secret_key = '' + ticket.save() + class Migration(migrations.Migration): dependencies = [ - ('helpdesk', '0018_fix_migrations'), + ('helpdesk', '0018_ticket_secret_key'), ] operations = [ migrations.AddField( model_name='ticket', name='secret_key', - field=models.CharField(default=helpdesk.models.mk_secret, max_length=36, verbose_name='Secret key needed for viewing/editing ticket by non-logged in users'), + field=models.CharField(default=helpdesk.models.mk_secret, max_length=36, + verbose_name='Secret key needed for viewing/editing ticket by non-logged in users'), ), migrations.RunPython(clear_secret_keys), ]