diff --git a/smartsoltech/comunication/telegram_bot.py b/smartsoltech/comunication/telegram_bot.py index 6199476..160e530 100644 --- a/smartsoltech/comunication/telegram_bot.py +++ b/smartsoltech/comunication/telegram_bot.py @@ -18,7 +18,11 @@ class TelegramBot: raise Exception("Telegram bot disabled for testing") # Получение настроек бота из базы данных - bot_settings = TelegramSettings.objects.first() + try: + bot_settings = TelegramSettings.objects.first() + except Exception as e: + logging.error(f"[TelegramBot] Ошибка доступа к настройкам: {e}") + raise Exception("Telegram bot settings not found or token is empty") if bot_settings and bot_settings.bot_token: TELEGRAM_BOT_TOKEN = bot_settings.bot_token.strip() diff --git a/smartsoltech/smartsoltech/settings.py b/smartsoltech/smartsoltech/settings.py index 80ab3c5..bd22784 100644 --- a/smartsoltech/smartsoltech/settings.py +++ b/smartsoltech/smartsoltech/settings.py @@ -30,7 +30,22 @@ DEBUG = True # Allowed hosts and CSRF trusted origins ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='localhost').split(',') -CSRF_TRUSTED_ORIGINS = config('CSRF_TRUSTED_ORIGINS', default='').split(',') + +# ИСПРАВЛЕНИЕ для Django 4.0+ совместимости +try: + csrf_origins_str = config('CSRF_TRUSTED_ORIGINS', default='') + if isinstance(csrf_origins_str, str) and csrf_origins_str.strip(): + CSRF_TRUSTED_ORIGINS = [origin.strip() for origin in csrf_origins_str.split(',') if origin.strip()] + else: + raise ValueError("Empty CSRF origins") +except: + # Для тестов и CI используем схемы по умолчанию + CSRF_TRUSTED_ORIGINS = [ + 'http://localhost', + 'http://127.0.0.1', + 'http://postgres', + 'https://smartsoltech.kr' + ] print(f"ALLOWED_HOSTS: {ALLOWED_HOSTS}") print(f"CSRF_TRUSTED_ORIGINS: {CSRF_TRUSTED_ORIGINS}") diff --git a/smartsoltech/web/templates/web/footer_modern.html b/smartsoltech/web/templates/web/footer_modern.html index f87a4c9..d854d11 100644 --- a/smartsoltech/web/templates/web/footer_modern.html +++ b/smartsoltech/web/templates/web/footer_modern.html @@ -90,19 +90,19 @@
- info@smartsoltech.kr + a.choi@smartsoltech.kr
- - +82-10-XXXX-XXXX + + +82-10-5693-6103
- Seoul, South Korea + Gwangju, South Korea
diff --git a/smartsoltech/web/templates/web/services_modern.html b/smartsoltech/web/templates/web/services_modern.html index 209a052..51006ba 100644 --- a/smartsoltech/web/templates/web/services_modern.html +++ b/smartsoltech/web/templates/web/services_modern.html @@ -234,7 +234,7 @@ Бесплатная консультация - + Скачать прайс-лист