From bb60df15fb4123dc2ea22a7bc5fc6de5a5429aec Mon Sep 17 00:00:00 2001 From: Abdullah Adeel Date: Fri, 21 Jan 2022 16:16:41 +0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20cookiecutter=20not=20gener?= =?UTF-8?q?ating=20proper=20template=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sites/migrations/0003_set_site_domain_and_name.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0003_set_site_domain_and_name.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0003_set_site_domain_and_name.py index b0eaff52b..0cd57b7bc 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0003_set_site_domain_and_name.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/contrib/sites/migrations/0003_set_site_domain_and_name.py @@ -25,7 +25,7 @@ def _update_or_create_site_with_sequence(site_model, connection, domain, name): # greater than the maximum value. max_id = site_model.objects.order_by('-id').first().id with connection.cursor() as cursor: - {% if cookiecutter.database_engine == 'postgresql' -%} + {%- if cookiecutter.database_engine == 'postgresql' %} cursor.execute("SELECT last_value from django_site_id_seq") (current_id,) = cursor.fetchone() if current_id <= max_id: @@ -33,7 +33,7 @@ def _update_or_create_site_with_sequence(site_model, connection, domain, name): "alter sequence django_site_id_seq restart with %s", [max_id + 1], ) - {% elif cookiecutter.database_engine == 'mysql' -%} + {%- elif cookiecutter.database_engine == 'mysql' %} cursor.execute("SELECT MAX(id) FROM django_site") (current_id,) = cursor.fetchone() if current_id <= max_id: @@ -41,7 +41,7 @@ def _update_or_create_site_with_sequence(site_model, connection, domain, name): "ALTER TABLE django_site AUTO_INCREMENT=%s", [max_id + 1], ) - {% endif -%} + {%- endif %} def update_site_forward(apps, schema_editor):