Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Use Django way of resoluting settings module (#10162)
Tomasz Magulskie183ea2aa76c
diff --git a/saleor/core/tasks.py b/saleor/core/tasks.pyindex c5ad2bb820..df795b6cdc 100644--- a/saleor/core/tasks.py+++ b/saleor/core/tasks.py@@ -1,11 +1,11 @@from botocore.exceptions import ClientError+from django.conf import settingsfrom django.core.files.storage import default_storagefrom django.db.models import Exists, OuterRef, Qfrom django.utils import timezonefrom ..celeryconf import appfrom ..product.models import ProductMedia-from ..settings import EVENT_PAYLOAD_DELETE_PERIODfrom ..thumbnail.models import Thumbnailfrom .models import EventDelivery, EventDeliveryAttempt, EventPayload@@ -17,7 +17,7 @@ def delete_from_storage_task(path):@app.taskdef delete_event_payloads_task():- delete_period = timezone.now() - EVENT_PAYLOAD_DELETE_PERIOD+ delete_period = timezone.now() - settings.EVENT_PAYLOAD_DELETE_PERIODdeliveries = EventDelivery.objects.filter(created_at__lte=delete_period)attempts = EventDeliveryAttempt.objects.filter(Q(Exists(deliveries.filter(id=OuterRef("delivery_id"))))diff --git a/saleor/graphql/account/mutations/account.py b/saleor/graphql/account/mutations/account.pyindex dcb393f3fe..ebe6d5918c 100644--- a/saleor/graphql/account/mutations/account.py+++ b/saleor/graphql/account/mutations/account.py@@ -17,7 +17,6 @@ from ....core.tracing import traced_atomic_transactionfrom ....core.utils.url import validate_storefront_urlfrom ....giftcard.utils import assign_user_gift_cardsfrom ....order.utils import match_orders_with_new_user-from ....settings import JWT_TTL_REQUEST_EMAIL_CHANGEfrom ...channel.utils import clean_channelfrom ...core.enums import LanguageCodeEnumfrom ...core.mutations import BaseMutation, ModelDeleteMutation, ModelMutation@@ -477,7 +476,7 @@ class RequestEmailChange(BaseMutation):"new_email": new_email,"user_pk": user.pk,}- token = create_token(token_payload, JWT_TTL_REQUEST_EMAIL_CHANGE)+ token = create_token(token_payload, settings.JWT_TTL_REQUEST_EMAIL_CHANGE)notifications.send_request_user_change_email_notification(redirect_url,user,diff --git a/saleor/plugins/webhook/tasks.py b/saleor/plugins/webhook/tasks.pyindex 3f1a8fc00e..2f7eee8206 100644--- a/saleor/plugins/webhook/tasks.py+++ b/saleor/plugins/webhook/tasks.py@@ -25,7 +25,6 @@ from ...graphql.webhook.subscription_payload import (initialize_request,)from ...payment import PaymentError-from ...settings import WEBHOOK_SYNC_TIMEOUT, WEBHOOK_TIMEOUTfrom ...site.models import Sitefrom ...webhook import observabilityfrom ...webhook.event_types import SUBSCRIBABLE_EVENTS, WebhookEventAsyncType@@ -181,7 +180,7 @@ def trigger_webhook_sync(def send_webhook_using_http(- target_url, message, domain, signature, event_type, timeout=WEBHOOK_TIMEOUT+ target_url, message, domain, signature, event_type, timeout=settings.WEBHOOK_TIMEOUT):"""Send a webhook request using http / https protocol.@@ -409,7 +408,7 @@ def send_webhook_request_async(self, event_delivery_id):def send_webhook_request_sync(- app_name, delivery, timeout=WEBHOOK_SYNC_TIMEOUT+ app_name, delivery, timeout=settings.WEBHOOK_SYNC_TIMEOUT) -> Optional[Dict[Any, Any]]:event_payload = delivery.payloaddata = event_payload.payload