From f1d530db2ab8d5ac82afe260de9bd319d90f359d Mon Sep 17 00:00:00 2001 From: tecbr <17889776+tecbr@users.noreply.github.com> Date: Thu, 9 Nov 2023 21:22:56 -0300 Subject: [PATCH] Fix 0034_create_email_template_for_merged.py --- helpdesk/migrations/0034_create_email_template_for_merged.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpdesk/migrations/0034_create_email_template_for_merged.py b/helpdesk/migrations/0034_create_email_template_for_merged.py index 42abe198..018faf57 100644 --- a/helpdesk/migrations/0034_create_email_template_for_merged.py +++ b/helpdesk/migrations/0034_create_email_template_for_merged.py @@ -7,7 +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 + id=EmailTemplate.objects.using(db_alias).order_by('-id').first().id + 1 if EmailTemplate.objects.using(db_alias).first() else 1, # because PG sequences are not reset template_name='merged', subject='(Merged)', heading='Ticket merged', @@ -24,7 +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 + id=EmailTemplate.objects.using(db_alias).order_by('-id').first().id + 1, # because PG sequences are not reset template_name='merged', subject='(Fusionné)', heading='Ticket Fusionné',