Commit graph

92 commits

Author SHA1 Message Date
859fa7290e Features: ;
Fixes: 1) Correct filtering logic to use stocks__vendor__name instead of vendor__name in admin query;

Extra: ;
2025-05-13 05:24:45 +03:00
ea0d14bfc8 Features: 1) Add "Stock.DoesNotExist" and "ProductImage.DoesNotExist" to ignored exceptions in base settings;
Fixes: 1) Ensure auto_resolver_helper returns only the created or fetched instance by accessing tuple index [0];

Extra: None;
2025-05-13 03:15:15 +03:00
2e9659a562 Features: 1) Update project version to 2.6.1 in pyproject.toml and settings.
Fixes: none;

Extra: none;
2025-05-13 03:03:26 +03:00
2d67b69b42 Features: ;
Fixes: ;

Extra: 1) Update environment variable values to "development" and "production" for clarity;
2025-05-13 02:53:15 +03:00
4a97779139 Features: 1) Extend ignored errors in Sentry when DEBUG mode is enabled;
Fixes: None;

Extra: 1) Refactor ignored errors list to conditionally include additional exceptions in DEBUG mode;
2025-05-13 02:50:27 +03:00
37c0867ab7 Features: 1) Add support for defaults in get_or_create for auto_resolver_helper; 2) Modularize Sentry ignore_errors configuration with a dedicated variable;
Fixes: None;

Extra: 1) Minor code refactor to streamline `ignore_errors` handling in Sentry setup;
2025-05-13 02:48:56 +03:00
78db5e1f96 Features: ;
Fixes: ;

Extra: 1) Simplify ignore_errors list by consolidating NotFoundErrorHandler entries.
2025-05-13 02:21:07 +03:00
87c355474c Features: 1) Enable Elasticsearch DSL autosync and switch to CelerySignalProcessor; 2) Extract common logic into auto_resolver_helper for resolving brands and categories; 3) Add conditional CACHEOPS_ENABLED based on sys arguments;
Fixes: 1) Add missing sys import in caches.py; 2) Ensure CACHEOPS_REDIS is only declared when CACHEOPS_ENABLED is True;

Extra: 1) Formatting and cleanup for readability in settings and auto-resolve methods; 2) Rearrange cacheops import in base settings;
2025-05-13 02:09:10 +03:00
8bdb74b80c Features: 1) Add prefetch_related for "attributes" in CategoryViewSet queryset;
Fixes: None;

Extra: None;
2025-05-12 20:22:31 +03:00
ae17cc1371 Features: 1) Add populate_index function for Elasticsearch indexing and integrate it into update_products; 2) Enhance CategoryViewSet queryset with prefetching of "parent" and "children";
Fixes: 1) Refine logic in vendor category and brand handling to correctly handle multiple active/inactive entries;

Extra: 1) Add missing import for `registry` in Elasticsearch module; 2) Minor cleanup and spacing adjustments in Elasticsearch and vendor modules.
2025-05-12 20:22:01 +03:00
c9d2881f99 Features: 1) Add TagNameListFilter for filtering products by tag names in admin panel; 2) Add VendorNameListFilter for filtering products by vendor names in admin panel;
Fixes: None;

Extra: 1) Replace redundant `list_filter` entries with new custom list filters for cleaner code structure;
2025-05-12 16:11:27 +03:00
4d2961bc81 Features: 1) Enhance admin list filters to support "__in" lookups for "is_active", "tags__tag_name", and "stocks__vendor__name";
Fixes:

Extra:
2025-05-12 16:02:32 +03:00
b18f962677 Features: 1) Add "stocks__vendor__name" to admin list filters;
Fixes:

Extra:
2025-05-12 15:08:23 +03:00
ee94464a7a Features:
Fixes:

Extra: 1) Add db_backups/ to .dockerignore file;
2025-05-12 15:02:13 +03:00
ad2e2f40ee Features:
Fixes:

Extra: 1) Remove unused sentry extra from Poetry install command in Dockerfile;
2025-05-12 10:17:05 +03:00
88a8c2e898 Features: 1) Activate translation based on request locale in CustomLocaleCommonMiddleware; 2) Activate translation within GrapheneJWTAuthorizationMiddleware;
Fixes: None;

Extra: None;
2025-05-12 10:16:31 +03:00
03eb6d03ca Features: 1) Replace hardcoded API version with dynamic EVIBES_VERSION; 2) Enhance Sentry SDK configuration to include Celery, OpenTelemetry, and Redis integration;
Fixes: 1) Correct file formatting for consistency in poetry.lock;

Extra: Perform general cleanup of file structure and hash formatting in poetry.lock for better readability;
2025-05-12 10:09:30 +03:00
11cca3b9f0 Features: 1) Add process_attribute method for handling product attributes in vendors module; 2) Introduce blocked_attributes list to manage excluded attributes; 3) Add dependency zeep to pyproject.toml.
Fixes: 1) Correctly handle `IntegrityError` and `MultipleObjectsReturned` exceptions in `process_attribute` to prevent crashes; 2) Add missing imports for `django.db.IntegrityError`, `Attribute`, and `AttributeGroup`.

Extra: Cleanup formatting in `poetry.lock` for consistent style.
2025-05-12 01:51:56 +03:00
ddeafdbd53 Features: 1) Replace CelerySignalProcessor with RealTimeSignalProcessor for Elasticsearch signal processing;
Fixes: None;

Extra: 1) Update indentation for improved readability; 2) Set ELASTICSEARCH_DSL_AUTOSYNC and ELASTICSEARCH_DSL_PARALLEL to False for configuration change;
2025-05-11 22:52:45 +03:00
be76a3bb8d Features: 1) Introduce conditional check ensuring instance.finalize() execution only when no order product errors exist;
Fixes: 1) Prevent potential incorrect execution of `instance.finalize()` by adding else block;

Extra: 1) Add spacing for improved readability; 2) Minor formatting tweaks in signal logic.
2025-05-11 22:46:45 +03:00
82667216f2 Features: None;
Fixes: 1) Prevent error by adding user check when processing non-PENDING orders; 2) Remove redundant status assignment and save for CREATED orders; 3) Add missing error handler for POST requests in settings;

Extra: None;
2025-05-11 22:43:38 +03:00
3185eb8188 Features: None;
Fixes: 1) Correct typo in 'exclude' method call for categories; 2) Correct typo in 'exclude' method call for brands;

Extra: None;
2025-05-09 06:57:41 +03:00
695058128e Features: 1) Add exception handling for Category.MultipleObjectsReturned and Brand.MultipleObjectsReturned; 2) Add aiosmtpd dependency to pyproject.toml.
Fixes: None;

Extra: 1) Update poetry.lock for the new aiosmtpd package; 2) Perform formatting changes to json and hash entries in poetry.lock for consistency.
2025-05-09 06:53:53 +03:00
fb91243718 Features: 1) Add management command to clear unwanted data including duplicate stocks and categories; 2) Automatically deactivate products without stocks; 3) Remove orphaned stocks.
Fixes: 1) None.

Extra: Refactored logic for grouped deletions and added success messages for better logging.
2025-05-09 04:51:21 +03:00
60c70e50f2 Features:
1) Add "created" and "modified" fields to list_filter in CategoryAdmin;

Fixes:
(none);

Extra:
(none);
2025-05-09 04:35:07 +03:00
ed16a4fd3d Revert "Features:"
This reverts commit a31ce44dfc.
2025-05-09 04:31:48 +03:00
a31ce44dfc Features:
1) Add Celery shared_task decorator to `update_stock` method for asynchronous execution.

Fixes:
1) Replace direct `update_stock()` calls with `update_stock.delay()` to enable task queuing.

Extra:
1) Add missing import for `shared_task` in `core/vendors/__init__.py`.
2025-05-09 04:29:07 +03:00
60240d4cd9 Features:
1) Extend worker task time limits (soft: 10800 seconds, hard: 21600 seconds);

Fixes:
(none);

Extra:
1) Update `docker-compose.yml` to reflect new task time limits in Celery command;
2025-05-09 04:19:13 +03:00
0a9a6dfd6c Features:
1) Add error handling with logger and custom error message for holiday API requests;

Fixes:
(none);

Extra:
1) Replace direct API response raising with try-except block for better robustness and logging;
2025-05-09 04:17:47 +03:00
7ef0dc6fa9 Features:
1) Add `BrandProductDetailSerializer` with logo fields (small_logo, big_logo);
2) Replace `BrandDetailSerializer` with `BrandProductDetailSerializer` in `ProductDetailSerializer`;

Fixes:
(none);

Extra:
1) Minor structural adjustments for code clarity;
2025-05-08 17:57:23 +03:00
ce5c475b71 Features:
1) Enhance `OpenApiParameter` usage by introducing structured keyword arguments to improve readability and maintainability;

Fixes:
1) Remove redundant `location` parameter for consistency in parameter definitions;

Extra:
1) Refactor `extend_schema` definitions with a uniform formatting style for better clarity and alignment;
2) Update response structures to improve readability and maintain consistent indentation.
2025-05-08 17:52:30 +03:00
0b25389d39 Features:
1) Add fallback to use `msgid` when user input is empty during translation prompt.

Fixes:
1) Fix alignment and indentation issues in API request data formatting.

Extra:
1) Minor formatting and whitespace cleanup in placeholder regex and related functions;
2) Regenerate `.mo` file for `cs_CZ` locale.
2025-05-08 17:45:00 +03:00
f5c1d64d46 Features:
1) Enhance lookup logic to support UUID validation for products in viewsets;
2) Add extensive filtering, sorting, and attributes documentation for product endpoints;
3) Define new OpenAPI parameters for querying products with detailed constraints.

Fixes:
1) Add missing import for `UUID` in core viewsets.

Extra:
1) Refactor and reorganize product API schema for clarity and consistency.
2025-05-08 17:33:40 +03:00
9941b45bd3 Features:
1) Add PRODUCT_SCHEMA to supported schemas;
2) Implement @extend_schema_view decorator for ProductViewSet;

Fixes:
1) None;

Extra:
1) None;
2025-05-08 17:25:14 +03:00
9f64b4214b Features:
1) None;

Fixes:
1) Corrected formatting of "fuzzy" flags in multiple locale `.po` files for consistent syntax;

Extra:
1) No functional changes, only formatting updates in translation files;
2025-05-08 17:15:33 +03:00
808e2aae25 Refactor category and brand resolution logic.
Improve handling of duplicate and inactive objects during category and brand resolution. Ensures only the most relevant entry is retained while unused duplicates are deleted. Fixes potential issues with object retrieval and creation logic.
2025-05-07 19:55:36 +03:00
0ed8a8d48e Remove unused serializer and update ignored error settings
The `BuyAsBusinessOrderSerializer` import was removed as it is no longer used. Additionally, new error types were added to the `ignore_errors` list in the base settings file to prevent unnecessary logging of expected exceptions.
2025-05-07 18:18:23 +03:00
974568cdee Fix fallback logic for object name extraction in search.
Updated the fallback chain to check for "title" if "name" is unavailable when extracting object names in Elasticsearch results. This ensures better handling of hits where "title" is present instead of "name".
2025-05-07 16:07:38 +03:00
0cb4ae42a4 Add support for search results for posts
Extended the search functionality to include results for posts. Updated `SearchResultsType` and related types to handle `posts`, adding a new `SearchPostsResultsType` with `uuid`, `name`, and `slug`. Adjusted mutations to populate posts in the search response.
2025-05-07 15:57:10 +03:00
80e1b0335b "Enhance product filtering and permissions handling
Ensure inactive products without stock are excluded from queries by updating the filter. Add 'buy_unregistered' action to permissions for better access control."
2025-05-07 15:07:48 +03:00
50fe95e713 Remove unused filters from admin panel configuration
This change eliminates redundant filters like "category", "attributes__attribute", and "brand" from the admin panel. This helps simplify the interface and improve usability.
2025-05-07 10:52:22 +03:00
e1f54304b6 Refactor error handling in auto_resolve methods.
Replaced context manager suppress(KeyError) with try-except blocks to handle both KeyError and IndexError in auto_resolve_category and auto_resolve_brand methods. This improves clarity and ensures proper handling of potential IndexError cases.
2025-05-07 10:40:40 +03:00
7f9f2d66f3 Ignore database backup files in .gitignore
Added `db_backups` to the `.gitignore` file to prevent accidental inclusion of backup files in version control. This helps maintain a cleaner repository and avoids potential security risks.
2025-05-07 09:49:21 +03:00
d1cd8515b5 Set console production log level to WARNING.
Updated the log level from INFO to WARNING in the console production handler. This change aims to reduce log noise and surface only warnings and errors in production environments.
2025-05-07 04:57:18 +03:00
4d63bde7a3 Refactor attribute retrieval logic in detail serializer.
Simplify the conditional logic for fetching attributes based on user permissions. This improves code readability and maintains the same functionality.
2025-05-07 04:40:44 +03:00
6c04faf97b Simplify Celery command formatting in docker-compose.yml
Consolidate the Celery worker command into a single line for improved readability and maintainability. This change reduces unnecessary line breaks without altering functionality.
2025-05-07 04:12:35 +03:00
1db400be6f Refactor celery command formatting in docker-compose.yml
Updated the Celery worker command in docker-compose.yml for better readability and consistency using line continuation characters. Ensured no functional changes were introduced during the formatting update.
2025-05-07 04:08:36 +03:00
5537830592 Update Dockerfile to configure PostgreSQL repository and client
Replaced Debian's PostgreSQL client with version 17 and added the PostgreSQL apt repository for more control over versions. Switched from `apt` to `apt-get` for consistency, and included necessary dependencies like `wget` and `gnupg` for repository setup.
2025-05-07 03:57:15 +03:00
5295948b8c Add postgresql-client to Dockerfile dependencies
The addition of `postgresql-client` ensures tools relying on PostgreSQL are available within the container. This change improves compatibility with PostgreSQL-based workflows and resolves potential missing dependencies.
2025-05-07 03:20:30 +03:00
87e124f614 Handle errors in vendor stock updates and inactive vendors
Add error handling during the stock update process to log and skip problematic vendors without halting execution. Additionally, ensure `get_vendor_instance` only returns active vendors, raising an error if the vendor is inactive. This improves system resilience and data integrity.
2025-05-07 03:15:23 +03:00