From 73138c3911d1969b53e7320c4532ee4d29fc9d45 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 11 Nov 2025 16:23:52 +0300 Subject: [PATCH 1/2] Features: 1) Update "Storefront" and "GraphQL Docs" links to use `BASE_DOMAIN` and `STOREFRONT_DOMAIN` constants. Fixes: 1) Add missing import for `BASE_DOMAIN` and `STOREFRONT_DOMAIN`. Extra: 1) Remove unused `base_domain` field from `ConfigType`. --- engine/core/graphene/object_types.py | 1 - evibes/settings/jazzmin.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/core/graphene/object_types.py b/engine/core/graphene/object_types.py index 2b3e9a7c..12423275 100644 --- a/engine/core/graphene/object_types.py +++ b/engine/core/graphene/object_types.py @@ -675,7 +675,6 @@ class CategoryTagType(DjangoObjectType): # type: ignore [misc] class ConfigType(ObjectType): # type: ignore [misc] project_name = String(description=_("project name")) - base_domain = String(description=_("company email")) company_name = String(description=_("company name")) company_address = String(description=_("company address")) company_phone_number = String(description=_("company phone number")) diff --git a/evibes/settings/jazzmin.py b/evibes/settings/jazzmin.py index 7e7b253e..40d54ee5 100644 --- a/evibes/settings/jazzmin.py +++ b/evibes/settings/jazzmin.py @@ -1,5 +1,6 @@ from django.utils.translation import gettext_lazy as _ +from evibes.settings import BASE_DOMAIN, STOREFRONT_DOMAIN from evibes.settings.base import EVIBES_VERSION from evibes.settings.constance import CONSTANCE_CONFIG @@ -18,11 +19,11 @@ JAZZMIN_SETTINGS = { "user_avatar": "avatar", "topmenu_links": [ {"name": _("Home"), "url": "admin:index"}, - {"name": _("Storefront"), "url": f"https://{CONSTANCE_CONFIG.get('BASE_DOMAIN')[0]}", "new_window": True}, # type: ignore [index] + {"name": _("Storefront"), "url": f"https://{STOREFRONT_DOMAIN}", "new_window": True}, # type: ignore [index] {"name": "GitLab", "url": "https://gitlab.com/wiseless/evibes", "new_window": True}, { "name": _("GraphQL Docs"), - "url": f"https://api.{CONSTANCE_CONFIG.get('BASE_DOMAIN')[0]}/graphql", # type: ignore [index] + "url": f"https://api.{BASE_DOMAIN}/graphql", # type: ignore [index] "new_window": True, }, { From da2403c3c588c52b59b37a550b3edfd0679d8c1d Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Tue, 11 Nov 2025 17:08:29 +0300 Subject: [PATCH 2/2] Features: 1) Centralize use of `BASE_DOMAIN` to replace `CONSTANCE_CONFIG` in API URLs. Fixes: 1) Add missing import for `BASE_DOMAIN` in `drf.py`. Extra: 1) Minor cleanup by removing redundant imports in `jazzmin.py`. --- evibes/settings/drf.py | 3 ++- evibes/settings/jazzmin.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/evibes/settings/drf.py b/evibes/settings/drf.py index 4fb2b281..e2571cc9 100644 --- a/evibes/settings/drf.py +++ b/evibes/settings/drf.py @@ -3,6 +3,7 @@ from os import getenv from django.utils.translation import gettext_lazy as _ +from evibes.settings import BASE_DOMAIN from evibes.settings.base import DEBUG, EVIBES_VERSION, SECRET_KEY from evibes.settings.constance import CONSTANCE_CONFIG @@ -136,7 +137,7 @@ SPECTACULAR_SETTINGS = { }, "SERVERS": [ { - "url": f"https://api.{CONSTANCE_CONFIG.get('BASE_DOMAIN')[0]}/", # type: ignore [index] + "url": f"https://api.{BASE_DOMAIN}/", # type: ignore [index] "description": "Production Server", }, {"url": "http://api.localhost:8000/", "description": "Development Server"}, diff --git a/evibes/settings/jazzmin.py b/evibes/settings/jazzmin.py index 40d54ee5..d664499c 100644 --- a/evibes/settings/jazzmin.py +++ b/evibes/settings/jazzmin.py @@ -1,7 +1,6 @@ from django.utils.translation import gettext_lazy as _ -from evibes.settings import BASE_DOMAIN, STOREFRONT_DOMAIN -from evibes.settings.base import EVIBES_VERSION +from evibes.settings.base import EVIBES_VERSION, BASE_DOMAIN, STOREFRONT_DOMAIN from evibes.settings.constance import CONSTANCE_CONFIG JAZZMIN_SETTINGS = { @@ -28,7 +27,7 @@ JAZZMIN_SETTINGS = { }, { "name": _("REST Docs"), - "url": f"https://api.{CONSTANCE_CONFIG.get('BASE_DOMAIN')[0]}/docs/swagger", # type: ignore [index] + "url": f"https://api.{BASE_DOMAIN}/docs/swagger", # type: ignore [index] "new_window": True, }, {"name": _("Support"), "url": "https://t.me/fureunoir", "new_window": True},