From 0dcee7fefe7d8ba86026389b3435a4af1a519568 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 4 Nov 2025 14:41:01 +0300 Subject: [PATCH] Features: None; Fixes: 1) Standardize string quotes in migration file; 2) Fix redundant parentheses in Elasticsearch query execution; Extra: Format cleanup and minor readability improvements. --- core/elasticsearch/__init__.py | 4 +--- core/migrations/0052_alter_stock_system_attributes.py | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/core/elasticsearch/__init__.py b/core/elasticsearch/__init__.py index 2549781a..3a6493ae 100644 --- a/core/elasticsearch/__init__.py +++ b/core/elasticsearch/__init__.py @@ -267,9 +267,7 @@ def process_query( ] for qx in product_exact_sequence: try: - resp_exact = ( - Search(index=["products"]).query(qx).extra(size=5, track_total_hits=False).execute() - ) + resp_exact = Search(index=["products"]).query(qx).extra(size=5, track_total_hits=False).execute() except NotFoundError: resp_exact = None if resp_exact is not None and getattr(resp_exact, "hits", None): diff --git a/core/migrations/0052_alter_stock_system_attributes.py b/core/migrations/0052_alter_stock_system_attributes.py index 4b571fbe..d3326d67 100644 --- a/core/migrations/0052_alter_stock_system_attributes.py +++ b/core/migrations/0052_alter_stock_system_attributes.py @@ -4,15 +4,14 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ - ('core', '0051_stock_system_attributes'), + ("core", "0051_stock_system_attributes"), ] operations = [ migrations.AlterField( - model_name='stock', - name='system_attributes', - field=models.JSONField(blank=True, default=dict, verbose_name='system attributes'), + model_name="stock", + name="system_attributes", + field=models.JSONField(blank=True, default=dict, verbose_name="system attributes"), ), ]