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), ] diff --git a/helpdesk/migrations/0034_create_email_template_for_merged.py b/helpdesk/migrations/0034_create_email_template_for_merged.py index 24f6896e..42abe198 100644 --- a/helpdesk/migrations/0034_create_email_template_for_merged.py +++ b/helpdesk/migrations/0034_create_email_template_for_merged.py @@ -7,6 +7,7 @@ def forwards_func(apps, schema_editor): EmailTemplate = apps.get_model("helpdesk", "EmailTemplate") db_alias = schema_editor.connection.alias EmailTemplate.objects.using(db_alias).create( + id=EmailTemplate.objects.order_by('-id').first().id + 1, # because PG sequences are not reset template_name='merged', subject='(Merged)', heading='Ticket merged', @@ -23,6 +24,7 @@ From now on, please answer on this ticket, or you can include the tag {{ ticket. locale='en' ) EmailTemplate.objects.using(db_alias).create( + id=EmailTemplate.objects.order_by('-id').first().id + 1, # because PG sequences are not reset template_name='merged', subject='(Fusionné)', heading='Ticket Fusionné', @@ -32,7 +34,7 @@ Ce courriel indicatif permet de vous prévenir que le ticket {{ ticket.ticket } Veillez à répondre sur ce ticket dorénavant, ou bien inclure la balise {{ ticket.merged_to.ticket }} dans le sujet de votre réponse par mail.""", html="""
Bonjour,
- +Ce courriel indicatif permet de vous prévenir que le ticket {{ ticket.ticket }} ({{ ticket.title }}) par {{ ticket.submitter_email }} a été fusionné au ticket {{ ticket.merged_to.ticket }}.
Veillez à répondre sur ce ticket dorénavant, ou bien inclure la balise {{ ticket.merged_to.ticket }} dans le sujet de votre réponse par mail.
""",