From c535a5195381469df3fdddc18c0f0a8b2f5c9825 Mon Sep 17 00:00:00 2001 From: trevor Date: Sat, 21 Dec 2024 21:56:15 +0900 Subject: [PATCH] merge --- .docker/admin/.dockerignore | 6 ++ .docker/admin/Dockerfile | 30 ++++++ .docker/admin/entrypoint.sh | 14 +++ .docker/admin/requirements.txt | 44 +++++++++ .docker/bot/.dockerignore | 6 ++ .docker/bot/Dockerfile | 12 +++ .docker/bot/requirements.txt | 44 +++++++++ .docker/scheduler/Dockerfile | 14 +++ .docker/scheduler/dockerignore | 6 ++ .docker/scheduler/entrypoint.sh | 7 ++ .docker/scheduler/requirements.txt | 44 +++++++++ antifroud/migrations/0002_initial.py | 32 +++++++ app_settings/__init__.py | 0 app_settings/admin.py | 24 +++++ app_settings/app_settings.py | 50 ++++++++++ app_settings/apps.py | 14 +++ app_settings/migrations/0001_initial.py | 86 +++++++++++++++++ app_settings/migrations/__init__.py | 0 app_settings/models.py | 77 +++++++++++++++ app_settings/signals.py | 9 ++ app_settings/tests.py | 3 + app_settings/urls.py | 11 +++ app_settings/views.py | 3 + docker-compose.yml | 73 ++++++++++++++ req1.txt | 65 +++++++++++++ scheduler/management/commands/__init__.py | 0 .../management/commands/run_scheduler.py | 27 ++++++ .../0002_alter_scheduledtask_function_path.py | 18 ++++ .../0003_alter_scheduledtask_function_path.py | 18 ++++ .../0004_alter_scheduledtask_function_path.py | 18 ++++ .../0005_alter_scheduledtask_function_path.py | 18 ++++ .../0006_alter_scheduledtask_function_path.py | 18 ++++ .../0007_alter_scheduledtask_function_path.py | 18 ++++ .../0008_alter_scheduledtask_function_path.py | 18 ++++ .../0009_alter_scheduledtask_function_path.py | 18 ++++ .../0010_alter_scheduledtask_function_path.py | 18 ++++ .../0011_alter_scheduledtask_function_path.py | 18 ++++ .../0012_alter_scheduledtask_function_path.py | 18 ++++ .../0013_alter_scheduledtask_function_path.py | 18 ++++ scheduler/task_loader.py | 95 +++++++++++++++++++ scheduler/urls.py | 14 +++ staticfiles/admin/js/collapse.js | 43 +++++++++ 42 files changed, 1069 insertions(+) create mode 100644 .docker/admin/.dockerignore create mode 100644 .docker/admin/Dockerfile create mode 100755 .docker/admin/entrypoint.sh create mode 100644 .docker/admin/requirements.txt create mode 100644 .docker/bot/.dockerignore create mode 100644 .docker/bot/Dockerfile create mode 100644 .docker/bot/requirements.txt create mode 100644 .docker/scheduler/Dockerfile create mode 100644 .docker/scheduler/dockerignore create mode 100755 .docker/scheduler/entrypoint.sh create mode 100644 .docker/scheduler/requirements.txt create mode 100644 antifroud/migrations/0002_initial.py create mode 100644 app_settings/__init__.py create mode 100644 app_settings/admin.py create mode 100644 app_settings/app_settings.py create mode 100644 app_settings/apps.py create mode 100644 app_settings/migrations/0001_initial.py create mode 100644 app_settings/migrations/__init__.py create mode 100644 app_settings/models.py create mode 100644 app_settings/signals.py create mode 100644 app_settings/tests.py create mode 100644 app_settings/urls.py create mode 100644 app_settings/views.py create mode 100644 docker-compose.yml create mode 100644 req1.txt create mode 100644 scheduler/management/commands/__init__.py create mode 100644 scheduler/management/commands/run_scheduler.py create mode 100644 scheduler/migrations/0002_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0003_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0004_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0005_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0006_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0007_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0008_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0009_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0010_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0011_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0012_alter_scheduledtask_function_path.py create mode 100644 scheduler/migrations/0013_alter_scheduledtask_function_path.py create mode 100644 scheduler/task_loader.py create mode 100644 scheduler/urls.py create mode 100644 staticfiles/admin/js/collapse.js diff --git a/.docker/admin/.dockerignore b/.docker/admin/.dockerignore new file mode 100644 index 00000000..b7045940 --- /dev/null +++ b/.docker/admin/.dockerignore @@ -0,0 +1,6 @@ +.venv +.venv/ +.log +__pycache__ +.history +.vscode diff --git a/.docker/admin/Dockerfile b/.docker/admin/Dockerfile new file mode 100644 index 00000000..8bc777f0 --- /dev/null +++ b/.docker/admin/Dockerfile @@ -0,0 +1,30 @@ +FROM python:3.9-alpine + +WORKDIR /app + +# Устанавливаем временную директорию +ENV TMPDIR=/tmp/tempdir +RUN mkdir -p $TMPDIR && chmod 1777 $TMPDIR + +# Устанавливаем системные зависимости для Alpine +RUN apk add --no-cache \ + gcc \ + musl-dev \ + mariadb-dev \ + netcat-openbsd \ + net-tools \ + iputils + +# Копируем только requirements.txt для кэширования зависимостей +COPY .docker/admin/requirements.txt /app/requirements.txt + +# Устанавливаем Python-зависимости +RUN pip install --upgrade pip && pip install --no-cache-dir -r /app/requirements.txt + +# Копируем весь проект +COPY . /app + +RUN chmod +x .docker/admin/entrypoint.sh +ENTRYPOINT [".docker/admin/entrypoint.sh"] + +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] diff --git a/.docker/admin/entrypoint.sh b/.docker/admin/entrypoint.sh new file mode 100755 index 00000000..116bf0c9 --- /dev/null +++ b/.docker/admin/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Ожидание доступности базы данных +until nc -z -v -w30 $DB_HOST $DB_PORT; do + echo "Ожидание базы данных..." + sleep 1 +done + +# Выполняем миграции +python manage.py makemigrations --no-input +python manage.py migrate --no-input + +# Запускаем приложение +exec "$@" diff --git a/.docker/admin/requirements.txt b/.docker/admin/requirements.txt new file mode 100644 index 00000000..07bb0743 --- /dev/null +++ b/.docker/admin/requirements.txt @@ -0,0 +1,44 @@ +ace_tools +aiohappyeyeballs +aiohttp +aiosignal +APScheduler +Django +django-environ +django_extensions +django-filter +django-health-check +django-jazzmin +django-jet +et_xmlfile +fonttools +fpdf2 +geoip2 +git-filter-repo +httpcore +httpx +jsonschema +jsonschema-specifications +maxminddb +multidict +PyMySQL +numpy +openpyxl +pandas +pathspec +pillow +propcache +psycopg +PyMySQL +python-dateutil +python-decouple +python-dotenv +python-telegram-bot +PyYAML +requests +sqlparse +ua-parser +ua-parser-builtins +user-agents +yarl +cryptography \ No newline at end of file diff --git a/.docker/bot/.dockerignore b/.docker/bot/.dockerignore new file mode 100644 index 00000000..b7045940 --- /dev/null +++ b/.docker/bot/.dockerignore @@ -0,0 +1,6 @@ +.venv +.venv/ +.log +__pycache__ +.history +.vscode diff --git a/.docker/bot/Dockerfile b/.docker/bot/Dockerfile new file mode 100644 index 00000000..11ee0136 --- /dev/null +++ b/.docker/bot/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.10-slim + +WORKDIR /app + +# Копируем весь проект в контейнер +COPY ../../ /app + +# Устанавливаем зависимости только для bot + +RUN pip install --upgrade pip && pip install --no-cache-dir -r .docker/bot/requirements.txt +# Команда запуска для бота +CMD ["python", "manage.py" ,"run_bot.py"] diff --git a/.docker/bot/requirements.txt b/.docker/bot/requirements.txt new file mode 100644 index 00000000..07bb0743 --- /dev/null +++ b/.docker/bot/requirements.txt @@ -0,0 +1,44 @@ +ace_tools +aiohappyeyeballs +aiohttp +aiosignal +APScheduler +Django +django-environ +django_extensions +django-filter +django-health-check +django-jazzmin +django-jet +et_xmlfile +fonttools +fpdf2 +geoip2 +git-filter-repo +httpcore +httpx +jsonschema +jsonschema-specifications +maxminddb +multidict +PyMySQL +numpy +openpyxl +pandas +pathspec +pillow +propcache +psycopg +PyMySQL +python-dateutil +python-decouple +python-dotenv +python-telegram-bot +PyYAML +requests +sqlparse +ua-parser +ua-parser-builtins +user-agents +yarl +cryptography \ No newline at end of file diff --git a/.docker/scheduler/Dockerfile b/.docker/scheduler/Dockerfile new file mode 100644 index 00000000..bb149829 --- /dev/null +++ b/.docker/scheduler/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.10-slim + +WORKDIR /app + +# Копируем весь проект в контейнер +COPY ../../ /app + +RUN chmod +x .docker/scheduler/entrypoint.sh +ENTRYPOINT [".docker/scheduler/entrypoint.sh"] +# Устанавливаем зависимости только для scheduler +RUN pip install --upgrade pip && pip install --no-cache-dir -r .docker/scheduler/requirements.txt + +# Команда запуска для планировщика +CMD ["python", "manage.py", "run_scheduler"] diff --git a/.docker/scheduler/dockerignore b/.docker/scheduler/dockerignore new file mode 100644 index 00000000..b7045940 --- /dev/null +++ b/.docker/scheduler/dockerignore @@ -0,0 +1,6 @@ +.venv +.venv/ +.log +__pycache__ +.history +.vscode diff --git a/.docker/scheduler/entrypoint.sh b/.docker/scheduler/entrypoint.sh new file mode 100755 index 00000000..f044c841 --- /dev/null +++ b/.docker/scheduler/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# Выполняем миграции +python manage.py migrate --no-input + +# Запускаем приложение +exec "$@" diff --git a/.docker/scheduler/requirements.txt b/.docker/scheduler/requirements.txt new file mode 100644 index 00000000..9a20c680 --- /dev/null +++ b/.docker/scheduler/requirements.txt @@ -0,0 +1,44 @@ +ace_tools +aiohappyeyeballs +aiohttp +aiosignal +APScheduler +Django +django-environ +django-extensions +django-filter +django-health-check +django-jazzmin +django-jet +et_xmlfile +fonttools +fpdf2 +geoip2 +git-filter-repo +httpcore +httpx +jsonschema +jsonschema-specifications +maxminddb +multidict +PyMySQL +numpy +openpyxl +pandas +pathspec +pillow +propcache +psycopg +PyMySQL +python-dateutil +python-decouple +python-dotenv +python-telegram-bot +PyYAML +requests +sqlparse +ua-parser +ua-parser-builtins +user-agents +yarl +cryptography \ No newline at end of file diff --git a/antifroud/migrations/0002_initial.py b/antifroud/migrations/0002_initial.py new file mode 100644 index 00000000..2e60fefd --- /dev/null +++ b/antifroud/migrations/0002_initial.py @@ -0,0 +1,32 @@ +# Generated by Django 5.1.4 on 2024-12-19 12:42 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('antifroud', '0001_initial'), + ('hotels', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='roomdiscrepancy', + name='hotel', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hotels.hotel', verbose_name='Отель'), + ), + migrations.AddField( + model_name='synclog', + name='hotel', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='hotels.hotel', verbose_name='Отель'), + ), + migrations.AddField( + model_name='violationlog', + name='hotel', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hotels.hotel', verbose_name='Отель'), + ), + ] diff --git a/app_settings/__init__.py b/app_settings/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app_settings/admin.py b/app_settings/admin.py new file mode 100644 index 00000000..7981a072 --- /dev/null +++ b/app_settings/admin.py @@ -0,0 +1,24 @@ +from django.contrib import admin +from .models import LocalDatabase, GlobalHotelSettings, GlobalSystemSettings, TelegramSettings, EmailSettings + +@admin.register(LocalDatabase) +class LocalDatabaseAdmin(admin.ModelAdmin): + list_display = ['name', 'host', 'port', 'user', 'database', 'is_active'] + search_fields = ['name', 'host', 'user', 'database'] + +@admin.register(GlobalHotelSettings) +class GlobalHotelSettingsAdmin(admin.ModelAdmin): + list_display = ['check_in_time', 'check_out_time', 'global_timezone'] + list_filter = ['global_timezone'] + +@admin.register(GlobalSystemSettings) +class GlobalSystemSettingsAdmin(admin.ModelAdmin): + list_display = ['system_name', 'system_version', 'server_timezone'] + +@admin.register(TelegramSettings) +class TelegramSettingsAdmin(admin.ModelAdmin): + list_display = ['bot_token', 'username'] + +@admin.register(EmailSettings) +class EmailSettingsAdmin(admin.ModelAdmin): + list_display = ['smtp_server', 'smtp_port', 'smtp_user', 'from_email'] diff --git a/app_settings/app_settings.py b/app_settings/app_settings.py new file mode 100644 index 00000000..5f9d1848 --- /dev/null +++ b/app_settings/app_settings.py @@ -0,0 +1,50 @@ +# settings.py + +from .models import LocalDatabase +from decouple import config +from django.conf import settings +from .models import LocalDatabase + +def load_database_settings(): + # Загружаем настройки из базы данных + local_db_settings = LocalDatabase.objects.all() + + for db in local_db_settings: + # Пример добавления дополнительной базы данных + settings.DATABASES[db.name] = { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': db.db_name, + 'USER': db.username, + 'PASSWORD': db.password, + 'HOST': db.host, + 'PORT': db.port, + } + +# Вызов этой функции при старте проекта, например, в файле wsgi.py +load_database_settings() + +# Чтение локальных баз данных +local_databases = LocalDatabase.objects.filter(is_active=True) + +# Основная база данных +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': config('DB_NAME'), + 'USER': config('DB_USER'), + 'PASSWORD': config('DB_PASSWORD'), + 'HOST': config('DB_HOST'), + 'PORT': config('DB_PORT'), + }, +} + +# Добавление локальных баз данных +for db in local_databases: + DATABASES[db.name] = { + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': db.name, + 'USER': db.user, + 'PASSWORD': db.password, + 'HOST': db.host, + 'PORT': db.port, + } diff --git a/app_settings/apps.py b/app_settings/apps.py new file mode 100644 index 00000000..e7bf0a4f --- /dev/null +++ b/app_settings/apps.py @@ -0,0 +1,14 @@ +from django.apps import AppConfig, apps + +class AppSettingsConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'app_settings' + + def ready(self): + # Проверяем, что приложения готовы + if not apps.ready: + return + try: + import app_settings.signals # Регистрация сигналов + except ImportError as e: + print(f"Ошибка импорта signals: {e}") diff --git a/app_settings/migrations/0001_initial.py b/app_settings/migrations/0001_initial.py new file mode 100644 index 00000000..53d0584e --- /dev/null +++ b/app_settings/migrations/0001_initial.py @@ -0,0 +1,86 @@ +# Generated by Django 5.1.4 on 2024-12-20 11:29 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='EmailSettings', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('smtp_server', models.CharField(help_text='SMTP сервер для отправки почты', max_length=255)), + ('smtp_port', models.IntegerField(default=587, help_text='SMTP порт для почты')), + ('smtp_user', models.CharField(help_text='Имя пользователя для SMTP', max_length=255)), + ('smtp_password', models.CharField(help_text='Пароль для SMTP', max_length=255)), + ('from_email', models.EmailField(help_text='Email для отправки сообщений', max_length=254)), + ], + options={ + 'verbose_name': 'E-mail', + 'verbose_name_plural': 'E-mails', + }, + ), + migrations.CreateModel( + name='GlobalHotelSettings', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('check_in_time', models.TimeField(help_text='Время заезда')), + ('check_out_time', models.TimeField(help_text='Время выезда')), + ('currency', models.CharField(help_text='Валюта', max_length=3)), + ('global_timezone', models.CharField(choices=[('Africa/Abidjan', 'Africa/Abidjan'), ('Africa/Accra', 'Africa/Accra'), ('Africa/Addis_Ababa', 'Africa/Addis_Ababa'), ('Africa/Algiers', 'Africa/Algiers'), ('Africa/Asmara', 'Africa/Asmara'), ('Africa/Asmera', 'Africa/Asmera'), ('Africa/Bamako', 'Africa/Bamako'), ('Africa/Bangui', 'Africa/Bangui'), ('Africa/Banjul', 'Africa/Banjul'), ('Africa/Bissau', 'Africa/Bissau'), ('Africa/Blantyre', 'Africa/Blantyre'), ('Africa/Brazzaville', 'Africa/Brazzaville'), ('Africa/Bujumbura', 'Africa/Bujumbura'), ('Africa/Cairo', 'Africa/Cairo'), ('Africa/Casablanca', 'Africa/Casablanca'), ('Africa/Ceuta', 'Africa/Ceuta'), ('Africa/Conakry', 'Africa/Conakry'), ('Africa/Dakar', 'Africa/Dakar'), ('Africa/Dar_es_Salaam', 'Africa/Dar_es_Salaam'), ('Africa/Djibouti', 'Africa/Djibouti'), ('Africa/Douala', 'Africa/Douala'), ('Africa/El_Aaiun', 'Africa/El_Aaiun'), ('Africa/Freetown', 'Africa/Freetown'), ('Africa/Gaborone', 'Africa/Gaborone'), ('Africa/Harare', 'Africa/Harare'), ('Africa/Johannesburg', 'Africa/Johannesburg'), ('Africa/Juba', 'Africa/Juba'), ('Africa/Kampala', 'Africa/Kampala'), ('Africa/Khartoum', 'Africa/Khartoum'), ('Africa/Kigali', 'Africa/Kigali'), ('Africa/Kinshasa', 'Africa/Kinshasa'), ('Africa/Lagos', 'Africa/Lagos'), ('Africa/Libreville', 'Africa/Libreville'), ('Africa/Lome', 'Africa/Lome'), ('Africa/Luanda', 'Africa/Luanda'), ('Africa/Lubumbashi', 'Africa/Lubumbashi'), ('Africa/Lusaka', 'Africa/Lusaka'), ('Africa/Malabo', 'Africa/Malabo'), ('Africa/Maputo', 'Africa/Maputo'), ('Africa/Maseru', 'Africa/Maseru'), ('Africa/Mbabane', 'Africa/Mbabane'), ('Africa/Mogadishu', 'Africa/Mogadishu'), ('Africa/Monrovia', 'Africa/Monrovia'), ('Africa/Nairobi', 'Africa/Nairobi'), ('Africa/Ndjamena', 'Africa/Ndjamena'), ('Africa/Niamey', 'Africa/Niamey'), ('Africa/Nouakchott', 'Africa/Nouakchott'), ('Africa/Ouagadougou', 'Africa/Ouagadougou'), ('Africa/Porto-Novo', 'Africa/Porto-Novo'), ('Africa/Sao_Tome', 'Africa/Sao_Tome'), ('Africa/Timbuktu', 'Africa/Timbuktu'), ('Africa/Tripoli', 'Africa/Tripoli'), ('Africa/Tunis', 'Africa/Tunis'), ('Africa/Windhoek', 'Africa/Windhoek'), ('America/Adak', 'America/Adak'), ('America/Anchorage', 'America/Anchorage'), ('America/Anguilla', 'America/Anguilla'), ('America/Antigua', 'America/Antigua'), ('America/Araguaina', 'America/Araguaina'), ('America/Argentina/Buenos_Aires', 'America/Argentina/Buenos_Aires'), ('America/Argentina/Catamarca', 'America/Argentina/Catamarca'), ('America/Argentina/ComodRivadavia', 'America/Argentina/ComodRivadavia'), ('America/Argentina/Cordoba', 'America/Argentina/Cordoba'), ('America/Argentina/Jujuy', 'America/Argentina/Jujuy'), ('America/Argentina/La_Rioja', 'America/Argentina/La_Rioja'), ('America/Argentina/Mendoza', 'America/Argentina/Mendoza'), ('America/Argentina/Rio_Gallegos', 'America/Argentina/Rio_Gallegos'), ('America/Argentina/Salta', 'America/Argentina/Salta'), ('America/Argentina/San_Juan', 'America/Argentina/San_Juan'), ('America/Argentina/San_Luis', 'America/Argentina/San_Luis'), ('America/Argentina/Tucuman', 'America/Argentina/Tucuman'), ('America/Argentina/Ushuaia', 'America/Argentina/Ushuaia'), ('America/Aruba', 'America/Aruba'), ('America/Asuncion', 'America/Asuncion'), ('America/Atikokan', 'America/Atikokan'), ('America/Atka', 'America/Atka'), ('America/Bahia', 'America/Bahia'), ('America/Bahia_Banderas', 'America/Bahia_Banderas'), ('America/Barbados', 'America/Barbados'), ('America/Belem', 'America/Belem'), ('America/Belize', 'America/Belize'), ('America/Blanc-Sablon', 'America/Blanc-Sablon'), ('America/Boa_Vista', 'America/Boa_Vista'), ('America/Bogota', 'America/Bogota'), ('America/Boise', 'America/Boise'), ('America/Buenos_Aires', 'America/Buenos_Aires'), ('America/Cambridge_Bay', 'America/Cambridge_Bay'), ('America/Campo_Grande', 'America/Campo_Grande'), ('America/Cancun', 'America/Cancun'), ('America/Caracas', 'America/Caracas'), ('America/Catamarca', 'America/Catamarca'), ('America/Cayenne', 'America/Cayenne'), ('America/Cayman', 'America/Cayman'), ('America/Chicago', 'America/Chicago'), ('America/Chihuahua', 'America/Chihuahua'), ('America/Ciudad_Juarez', 'America/Ciudad_Juarez'), ('America/Coral_Harbour', 'America/Coral_Harbour'), ('America/Cordoba', 'America/Cordoba'), ('America/Costa_Rica', 'America/Costa_Rica'), ('America/Creston', 'America/Creston'), ('America/Cuiaba', 'America/Cuiaba'), ('America/Curacao', 'America/Curacao'), ('America/Danmarkshavn', 'America/Danmarkshavn'), ('America/Dawson', 'America/Dawson'), ('America/Dawson_Creek', 'America/Dawson_Creek'), ('America/Denver', 'America/Denver'), ('America/Detroit', 'America/Detroit'), ('America/Dominica', 'America/Dominica'), ('America/Edmonton', 'America/Edmonton'), ('America/Eirunepe', 'America/Eirunepe'), ('America/El_Salvador', 'America/El_Salvador'), ('America/Ensenada', 'America/Ensenada'), ('America/Fort_Nelson', 'America/Fort_Nelson'), ('America/Fort_Wayne', 'America/Fort_Wayne'), ('America/Fortaleza', 'America/Fortaleza'), ('America/Glace_Bay', 'America/Glace_Bay'), ('America/Godthab', 'America/Godthab'), ('America/Goose_Bay', 'America/Goose_Bay'), ('America/Grand_Turk', 'America/Grand_Turk'), ('America/Grenada', 'America/Grenada'), ('America/Guadeloupe', 'America/Guadeloupe'), ('America/Guatemala', 'America/Guatemala'), ('America/Guayaquil', 'America/Guayaquil'), ('America/Guyana', 'America/Guyana'), ('America/Halifax', 'America/Halifax'), ('America/Havana', 'America/Havana'), ('America/Hermosillo', 'America/Hermosillo'), ('America/Indiana/Indianapolis', 'America/Indiana/Indianapolis'), ('America/Indiana/Knox', 'America/Indiana/Knox'), ('America/Indiana/Marengo', 'America/Indiana/Marengo'), ('America/Indiana/Petersburg', 'America/Indiana/Petersburg'), ('America/Indiana/Tell_City', 'America/Indiana/Tell_City'), ('America/Indiana/Vevay', 'America/Indiana/Vevay'), ('America/Indiana/Vincennes', 'America/Indiana/Vincennes'), ('America/Indiana/Winamac', 'America/Indiana/Winamac'), ('America/Indianapolis', 'America/Indianapolis'), ('America/Inuvik', 'America/Inuvik'), ('America/Iqaluit', 'America/Iqaluit'), ('America/Jamaica', 'America/Jamaica'), ('America/Jujuy', 'America/Jujuy'), ('America/Juneau', 'America/Juneau'), ('America/Kentucky/Louisville', 'America/Kentucky/Louisville'), ('America/Kentucky/Monticello', 'America/Kentucky/Monticello'), ('America/Knox_IN', 'America/Knox_IN'), ('America/Kralendijk', 'America/Kralendijk'), ('America/La_Paz', 'America/La_Paz'), ('America/Lima', 'America/Lima'), ('America/Los_Angeles', 'America/Los_Angeles'), ('America/Louisville', 'America/Louisville'), ('America/Lower_Princes', 'America/Lower_Princes'), ('America/Maceio', 'America/Maceio'), ('America/Managua', 'America/Managua'), ('America/Manaus', 'America/Manaus'), ('America/Marigot', 'America/Marigot'), ('America/Martinique', 'America/Martinique'), ('America/Matamoros', 'America/Matamoros'), ('America/Mazatlan', 'America/Mazatlan'), ('America/Mendoza', 'America/Mendoza'), ('America/Menominee', 'America/Menominee'), ('America/Merida', 'America/Merida'), ('America/Metlakatla', 'America/Metlakatla'), ('America/Mexico_City', 'America/Mexico_City'), ('America/Miquelon', 'America/Miquelon'), ('America/Moncton', 'America/Moncton'), ('America/Monterrey', 'America/Monterrey'), ('America/Montevideo', 'America/Montevideo'), ('America/Montreal', 'America/Montreal'), ('America/Montserrat', 'America/Montserrat'), ('America/Nassau', 'America/Nassau'), ('America/New_York', 'America/New_York'), ('America/Nipigon', 'America/Nipigon'), ('America/Nome', 'America/Nome'), ('America/Noronha', 'America/Noronha'), ('America/North_Dakota/Beulah', 'America/North_Dakota/Beulah'), ('America/North_Dakota/Center', 'America/North_Dakota/Center'), ('America/North_Dakota/New_Salem', 'America/North_Dakota/New_Salem'), ('America/Nuuk', 'America/Nuuk'), ('America/Ojinaga', 'America/Ojinaga'), ('America/Panama', 'America/Panama'), ('America/Pangnirtung', 'America/Pangnirtung'), ('America/Paramaribo', 'America/Paramaribo'), ('America/Phoenix', 'America/Phoenix'), ('America/Port-au-Prince', 'America/Port-au-Prince'), ('America/Port_of_Spain', 'America/Port_of_Spain'), ('America/Porto_Acre', 'America/Porto_Acre'), ('America/Porto_Velho', 'America/Porto_Velho'), ('America/Puerto_Rico', 'America/Puerto_Rico'), ('America/Punta_Arenas', 'America/Punta_Arenas'), ('America/Rainy_River', 'America/Rainy_River'), ('America/Rankin_Inlet', 'America/Rankin_Inlet'), ('America/Recife', 'America/Recife'), ('America/Regina', 'America/Regina'), ('America/Resolute', 'America/Resolute'), ('America/Rio_Branco', 'America/Rio_Branco'), ('America/Rosario', 'America/Rosario'), ('America/Santa_Isabel', 'America/Santa_Isabel'), ('America/Santarem', 'America/Santarem'), ('America/Santiago', 'America/Santiago'), ('America/Santo_Domingo', 'America/Santo_Domingo'), ('America/Sao_Paulo', 'America/Sao_Paulo'), ('America/Scoresbysund', 'America/Scoresbysund'), ('America/Shiprock', 'America/Shiprock'), ('America/Sitka', 'America/Sitka'), ('America/St_Barthelemy', 'America/St_Barthelemy'), ('America/St_Johns', 'America/St_Johns'), ('America/St_Kitts', 'America/St_Kitts'), ('America/St_Lucia', 'America/St_Lucia'), ('America/St_Thomas', 'America/St_Thomas'), ('America/St_Vincent', 'America/St_Vincent'), ('America/Swift_Current', 'America/Swift_Current'), ('America/Tegucigalpa', 'America/Tegucigalpa'), ('America/Thule', 'America/Thule'), ('America/Thunder_Bay', 'America/Thunder_Bay'), ('America/Tijuana', 'America/Tijuana'), ('America/Toronto', 'America/Toronto'), ('America/Tortola', 'America/Tortola'), ('America/Vancouver', 'America/Vancouver'), ('America/Virgin', 'America/Virgin'), ('America/Whitehorse', 'America/Whitehorse'), ('America/Winnipeg', 'America/Winnipeg'), ('America/Yakutat', 'America/Yakutat'), ('America/Yellowknife', 'America/Yellowknife'), ('Antarctica/Casey', 'Antarctica/Casey'), ('Antarctica/Davis', 'Antarctica/Davis'), ('Antarctica/DumontDUrville', 'Antarctica/DumontDUrville'), ('Antarctica/Macquarie', 'Antarctica/Macquarie'), ('Antarctica/Mawson', 'Antarctica/Mawson'), ('Antarctica/McMurdo', 'Antarctica/McMurdo'), ('Antarctica/Palmer', 'Antarctica/Palmer'), ('Antarctica/Rothera', 'Antarctica/Rothera'), ('Antarctica/South_Pole', 'Antarctica/South_Pole'), ('Antarctica/Syowa', 'Antarctica/Syowa'), ('Antarctica/Troll', 'Antarctica/Troll'), ('Antarctica/Vostok', 'Antarctica/Vostok'), ('Arctic/Longyearbyen', 'Arctic/Longyearbyen'), ('Asia/Aden', 'Asia/Aden'), ('Asia/Almaty', 'Asia/Almaty'), ('Asia/Amman', 'Asia/Amman'), ('Asia/Anadyr', 'Asia/Anadyr'), ('Asia/Aqtau', 'Asia/Aqtau'), ('Asia/Aqtobe', 'Asia/Aqtobe'), ('Asia/Ashgabat', 'Asia/Ashgabat'), ('Asia/Ashkhabad', 'Asia/Ashkhabad'), ('Asia/Atyrau', 'Asia/Atyrau'), ('Asia/Baghdad', 'Asia/Baghdad'), ('Asia/Bahrain', 'Asia/Bahrain'), ('Asia/Baku', 'Asia/Baku'), ('Asia/Bangkok', 'Asia/Bangkok'), ('Asia/Barnaul', 'Asia/Barnaul'), ('Asia/Beirut', 'Asia/Beirut'), ('Asia/Bishkek', 'Asia/Bishkek'), ('Asia/Brunei', 'Asia/Brunei'), ('Asia/Calcutta', 'Asia/Calcutta'), ('Asia/Chita', 'Asia/Chita'), ('Asia/Choibalsan', 'Asia/Choibalsan'), ('Asia/Chongqing', 'Asia/Chongqing'), ('Asia/Chungking', 'Asia/Chungking'), ('Asia/Colombo', 'Asia/Colombo'), ('Asia/Dacca', 'Asia/Dacca'), ('Asia/Damascus', 'Asia/Damascus'), ('Asia/Dhaka', 'Asia/Dhaka'), ('Asia/Dili', 'Asia/Dili'), ('Asia/Dubai', 'Asia/Dubai'), ('Asia/Dushanbe', 'Asia/Dushanbe'), ('Asia/Famagusta', 'Asia/Famagusta'), ('Asia/Gaza', 'Asia/Gaza'), ('Asia/Harbin', 'Asia/Harbin'), ('Asia/Hebron', 'Asia/Hebron'), ('Asia/Ho_Chi_Minh', 'Asia/Ho_Chi_Minh'), ('Asia/Hong_Kong', 'Asia/Hong_Kong'), ('Asia/Hovd', 'Asia/Hovd'), ('Asia/Irkutsk', 'Asia/Irkutsk'), ('Asia/Istanbul', 'Asia/Istanbul'), ('Asia/Jakarta', 'Asia/Jakarta'), ('Asia/Jayapura', 'Asia/Jayapura'), ('Asia/Jerusalem', 'Asia/Jerusalem'), ('Asia/Kabul', 'Asia/Kabul'), ('Asia/Kamchatka', 'Asia/Kamchatka'), ('Asia/Karachi', 'Asia/Karachi'), ('Asia/Kashgar', 'Asia/Kashgar'), ('Asia/Kathmandu', 'Asia/Kathmandu'), ('Asia/Katmandu', 'Asia/Katmandu'), ('Asia/Khandyga', 'Asia/Khandyga'), ('Asia/Kolkata', 'Asia/Kolkata'), ('Asia/Krasnoyarsk', 'Asia/Krasnoyarsk'), ('Asia/Kuala_Lumpur', 'Asia/Kuala_Lumpur'), ('Asia/Kuching', 'Asia/Kuching'), ('Asia/Kuwait', 'Asia/Kuwait'), ('Asia/Macao', 'Asia/Macao'), ('Asia/Macau', 'Asia/Macau'), ('Asia/Magadan', 'Asia/Magadan'), ('Asia/Makassar', 'Asia/Makassar'), ('Asia/Manila', 'Asia/Manila'), ('Asia/Muscat', 'Asia/Muscat'), ('Asia/Nicosia', 'Asia/Nicosia'), ('Asia/Novokuznetsk', 'Asia/Novokuznetsk'), ('Asia/Novosibirsk', 'Asia/Novosibirsk'), ('Asia/Omsk', 'Asia/Omsk'), ('Asia/Oral', 'Asia/Oral'), ('Asia/Phnom_Penh', 'Asia/Phnom_Penh'), ('Asia/Pontianak', 'Asia/Pontianak'), ('Asia/Pyongyang', 'Asia/Pyongyang'), ('Asia/Qatar', 'Asia/Qatar'), ('Asia/Qostanay', 'Asia/Qostanay'), ('Asia/Qyzylorda', 'Asia/Qyzylorda'), ('Asia/Rangoon', 'Asia/Rangoon'), ('Asia/Riyadh', 'Asia/Riyadh'), ('Asia/Saigon', 'Asia/Saigon'), ('Asia/Sakhalin', 'Asia/Sakhalin'), ('Asia/Samarkand', 'Asia/Samarkand'), ('Asia/Seoul', 'Asia/Seoul'), ('Asia/Shanghai', 'Asia/Shanghai'), ('Asia/Singapore', 'Asia/Singapore'), ('Asia/Srednekolymsk', 'Asia/Srednekolymsk'), ('Asia/Taipei', 'Asia/Taipei'), ('Asia/Tashkent', 'Asia/Tashkent'), ('Asia/Tbilisi', 'Asia/Tbilisi'), ('Asia/Tehran', 'Asia/Tehran'), ('Asia/Tel_Aviv', 'Asia/Tel_Aviv'), ('Asia/Thimbu', 'Asia/Thimbu'), ('Asia/Thimphu', 'Asia/Thimphu'), ('Asia/Tokyo', 'Asia/Tokyo'), ('Asia/Tomsk', 'Asia/Tomsk'), ('Asia/Ujung_Pandang', 'Asia/Ujung_Pandang'), ('Asia/Ulaanbaatar', 'Asia/Ulaanbaatar'), ('Asia/Ulan_Bator', 'Asia/Ulan_Bator'), ('Asia/Urumqi', 'Asia/Urumqi'), ('Asia/Ust-Nera', 'Asia/Ust-Nera'), ('Asia/Vientiane', 'Asia/Vientiane'), ('Asia/Vladivostok', 'Asia/Vladivostok'), ('Asia/Yakutsk', 'Asia/Yakutsk'), ('Asia/Yangon', 'Asia/Yangon'), ('Asia/Yekaterinburg', 'Asia/Yekaterinburg'), ('Asia/Yerevan', 'Asia/Yerevan'), ('Atlantic/Azores', 'Atlantic/Azores'), ('Atlantic/Bermuda', 'Atlantic/Bermuda'), ('Atlantic/Canary', 'Atlantic/Canary'), ('Atlantic/Cape_Verde', 'Atlantic/Cape_Verde'), ('Atlantic/Faeroe', 'Atlantic/Faeroe'), ('Atlantic/Faroe', 'Atlantic/Faroe'), ('Atlantic/Jan_Mayen', 'Atlantic/Jan_Mayen'), ('Atlantic/Madeira', 'Atlantic/Madeira'), ('Atlantic/Reykjavik', 'Atlantic/Reykjavik'), ('Atlantic/South_Georgia', 'Atlantic/South_Georgia'), ('Atlantic/St_Helena', 'Atlantic/St_Helena'), ('Atlantic/Stanley', 'Atlantic/Stanley'), ('Australia/ACT', 'Australia/ACT'), ('Australia/Adelaide', 'Australia/Adelaide'), ('Australia/Brisbane', 'Australia/Brisbane'), ('Australia/Broken_Hill', 'Australia/Broken_Hill'), ('Australia/Canberra', 'Australia/Canberra'), ('Australia/Currie', 'Australia/Currie'), ('Australia/Darwin', 'Australia/Darwin'), ('Australia/Eucla', 'Australia/Eucla'), ('Australia/Hobart', 'Australia/Hobart'), ('Australia/LHI', 'Australia/LHI'), ('Australia/Lindeman', 'Australia/Lindeman'), ('Australia/Lord_Howe', 'Australia/Lord_Howe'), ('Australia/Melbourne', 'Australia/Melbourne'), ('Australia/NSW', 'Australia/NSW'), ('Australia/North', 'Australia/North'), ('Australia/Perth', 'Australia/Perth'), ('Australia/Queensland', 'Australia/Queensland'), ('Australia/South', 'Australia/South'), ('Australia/Sydney', 'Australia/Sydney'), ('Australia/Tasmania', 'Australia/Tasmania'), ('Australia/Victoria', 'Australia/Victoria'), ('Australia/West', 'Australia/West'), ('Australia/Yancowinna', 'Australia/Yancowinna'), ('Brazil/Acre', 'Brazil/Acre'), ('Brazil/DeNoronha', 'Brazil/DeNoronha'), ('Brazil/East', 'Brazil/East'), ('Brazil/West', 'Brazil/West'), ('CET', 'CET'), ('CST6CDT', 'CST6CDT'), ('Canada/Atlantic', 'Canada/Atlantic'), ('Canada/Central', 'Canada/Central'), ('Canada/Eastern', 'Canada/Eastern'), ('Canada/Mountain', 'Canada/Mountain'), ('Canada/Newfoundland', 'Canada/Newfoundland'), ('Canada/Pacific', 'Canada/Pacific'), ('Canada/Saskatchewan', 'Canada/Saskatchewan'), ('Canada/Yukon', 'Canada/Yukon'), ('Chile/Continental', 'Chile/Continental'), ('Chile/EasterIsland', 'Chile/EasterIsland'), ('Cuba', 'Cuba'), ('EET', 'EET'), ('EST', 'EST'), ('EST5EDT', 'EST5EDT'), ('Egypt', 'Egypt'), ('Eire', 'Eire'), ('Etc/GMT', 'Etc/GMT'), ('Etc/GMT+0', 'Etc/GMT+0'), ('Etc/GMT+1', 'Etc/GMT+1'), ('Etc/GMT+10', 'Etc/GMT+10'), ('Etc/GMT+11', 'Etc/GMT+11'), ('Etc/GMT+12', 'Etc/GMT+12'), ('Etc/GMT+2', 'Etc/GMT+2'), ('Etc/GMT+3', 'Etc/GMT+3'), ('Etc/GMT+4', 'Etc/GMT+4'), ('Etc/GMT+5', 'Etc/GMT+5'), ('Etc/GMT+6', 'Etc/GMT+6'), ('Etc/GMT+7', 'Etc/GMT+7'), ('Etc/GMT+8', 'Etc/GMT+8'), ('Etc/GMT+9', 'Etc/GMT+9'), ('Etc/GMT-0', 'Etc/GMT-0'), ('Etc/GMT-1', 'Etc/GMT-1'), ('Etc/GMT-10', 'Etc/GMT-10'), ('Etc/GMT-11', 'Etc/GMT-11'), ('Etc/GMT-12', 'Etc/GMT-12'), ('Etc/GMT-13', 'Etc/GMT-13'), ('Etc/GMT-14', 'Etc/GMT-14'), ('Etc/GMT-2', 'Etc/GMT-2'), ('Etc/GMT-3', 'Etc/GMT-3'), ('Etc/GMT-4', 'Etc/GMT-4'), ('Etc/GMT-5', 'Etc/GMT-5'), ('Etc/GMT-6', 'Etc/GMT-6'), ('Etc/GMT-7', 'Etc/GMT-7'), ('Etc/GMT-8', 'Etc/GMT-8'), ('Etc/GMT-9', 'Etc/GMT-9'), ('Etc/GMT0', 'Etc/GMT0'), ('Etc/Greenwich', 'Etc/Greenwich'), ('Etc/UCT', 'Etc/UCT'), ('Etc/UTC', 'Etc/UTC'), ('Etc/Universal', 'Etc/Universal'), ('Etc/Zulu', 'Etc/Zulu'), ('Europe/Amsterdam', 'Europe/Amsterdam'), ('Europe/Andorra', 'Europe/Andorra'), ('Europe/Astrakhan', 'Europe/Astrakhan'), ('Europe/Athens', 'Europe/Athens'), ('Europe/Belfast', 'Europe/Belfast'), ('Europe/Belgrade', 'Europe/Belgrade'), ('Europe/Berlin', 'Europe/Berlin'), ('Europe/Bratislava', 'Europe/Bratislava'), ('Europe/Brussels', 'Europe/Brussels'), ('Europe/Bucharest', 'Europe/Bucharest'), ('Europe/Budapest', 'Europe/Budapest'), ('Europe/Busingen', 'Europe/Busingen'), ('Europe/Chisinau', 'Europe/Chisinau'), ('Europe/Copenhagen', 'Europe/Copenhagen'), ('Europe/Dublin', 'Europe/Dublin'), ('Europe/Gibraltar', 'Europe/Gibraltar'), ('Europe/Guernsey', 'Europe/Guernsey'), ('Europe/Helsinki', 'Europe/Helsinki'), ('Europe/Isle_of_Man', 'Europe/Isle_of_Man'), ('Europe/Istanbul', 'Europe/Istanbul'), ('Europe/Jersey', 'Europe/Jersey'), ('Europe/Kaliningrad', 'Europe/Kaliningrad'), ('Europe/Kiev', 'Europe/Kiev'), ('Europe/Kirov', 'Europe/Kirov'), ('Europe/Kyiv', 'Europe/Kyiv'), ('Europe/Lisbon', 'Europe/Lisbon'), ('Europe/Ljubljana', 'Europe/Ljubljana'), ('Europe/London', 'Europe/London'), ('Europe/Luxembourg', 'Europe/Luxembourg'), ('Europe/Madrid', 'Europe/Madrid'), ('Europe/Malta', 'Europe/Malta'), ('Europe/Mariehamn', 'Europe/Mariehamn'), ('Europe/Minsk', 'Europe/Minsk'), ('Europe/Monaco', 'Europe/Monaco'), ('Europe/Moscow', 'Europe/Moscow'), ('Europe/Nicosia', 'Europe/Nicosia'), ('Europe/Oslo', 'Europe/Oslo'), ('Europe/Paris', 'Europe/Paris'), ('Europe/Podgorica', 'Europe/Podgorica'), ('Europe/Prague', 'Europe/Prague'), ('Europe/Riga', 'Europe/Riga'), ('Europe/Rome', 'Europe/Rome'), ('Europe/Samara', 'Europe/Samara'), ('Europe/San_Marino', 'Europe/San_Marino'), ('Europe/Sarajevo', 'Europe/Sarajevo'), ('Europe/Saratov', 'Europe/Saratov'), ('Europe/Simferopol', 'Europe/Simferopol'), ('Europe/Skopje', 'Europe/Skopje'), ('Europe/Sofia', 'Europe/Sofia'), ('Europe/Stockholm', 'Europe/Stockholm'), ('Europe/Tallinn', 'Europe/Tallinn'), ('Europe/Tirane', 'Europe/Tirane'), ('Europe/Tiraspol', 'Europe/Tiraspol'), ('Europe/Ulyanovsk', 'Europe/Ulyanovsk'), ('Europe/Uzhgorod', 'Europe/Uzhgorod'), ('Europe/Vaduz', 'Europe/Vaduz'), ('Europe/Vatican', 'Europe/Vatican'), ('Europe/Vienna', 'Europe/Vienna'), ('Europe/Vilnius', 'Europe/Vilnius'), ('Europe/Volgograd', 'Europe/Volgograd'), ('Europe/Warsaw', 'Europe/Warsaw'), ('Europe/Zagreb', 'Europe/Zagreb'), ('Europe/Zaporozhye', 'Europe/Zaporozhye'), ('Europe/Zurich', 'Europe/Zurich'), ('GB', 'GB'), ('GB-Eire', 'GB-Eire'), ('GMT', 'GMT'), ('GMT+0', 'GMT+0'), ('GMT-0', 'GMT-0'), ('GMT0', 'GMT0'), ('Greenwich', 'Greenwich'), ('HST', 'HST'), ('Hongkong', 'Hongkong'), ('Iceland', 'Iceland'), ('Indian/Antananarivo', 'Indian/Antananarivo'), ('Indian/Chagos', 'Indian/Chagos'), ('Indian/Christmas', 'Indian/Christmas'), ('Indian/Cocos', 'Indian/Cocos'), ('Indian/Comoro', 'Indian/Comoro'), ('Indian/Kerguelen', 'Indian/Kerguelen'), ('Indian/Mahe', 'Indian/Mahe'), ('Indian/Maldives', 'Indian/Maldives'), ('Indian/Mauritius', 'Indian/Mauritius'), ('Indian/Mayotte', 'Indian/Mayotte'), ('Indian/Reunion', 'Indian/Reunion'), ('Iran', 'Iran'), ('Israel', 'Israel'), ('Jamaica', 'Jamaica'), ('Japan', 'Japan'), ('Kwajalein', 'Kwajalein'), ('Libya', 'Libya'), ('MET', 'MET'), ('MST', 'MST'), ('MST7MDT', 'MST7MDT'), ('Mexico/BajaNorte', 'Mexico/BajaNorte'), ('Mexico/BajaSur', 'Mexico/BajaSur'), ('Mexico/General', 'Mexico/General'), ('NZ', 'NZ'), ('NZ-CHAT', 'NZ-CHAT'), ('Navajo', 'Navajo'), ('PRC', 'PRC'), ('PST8PDT', 'PST8PDT'), ('Pacific/Apia', 'Pacific/Apia'), ('Pacific/Auckland', 'Pacific/Auckland'), ('Pacific/Bougainville', 'Pacific/Bougainville'), ('Pacific/Chatham', 'Pacific/Chatham'), ('Pacific/Chuuk', 'Pacific/Chuuk'), ('Pacific/Easter', 'Pacific/Easter'), ('Pacific/Efate', 'Pacific/Efate'), ('Pacific/Enderbury', 'Pacific/Enderbury'), ('Pacific/Fakaofo', 'Pacific/Fakaofo'), ('Pacific/Fiji', 'Pacific/Fiji'), ('Pacific/Funafuti', 'Pacific/Funafuti'), ('Pacific/Galapagos', 'Pacific/Galapagos'), ('Pacific/Gambier', 'Pacific/Gambier'), ('Pacific/Guadalcanal', 'Pacific/Guadalcanal'), ('Pacific/Guam', 'Pacific/Guam'), ('Pacific/Honolulu', 'Pacific/Honolulu'), ('Pacific/Johnston', 'Pacific/Johnston'), ('Pacific/Kanton', 'Pacific/Kanton'), ('Pacific/Kiritimati', 'Pacific/Kiritimati'), ('Pacific/Kosrae', 'Pacific/Kosrae'), ('Pacific/Kwajalein', 'Pacific/Kwajalein'), ('Pacific/Majuro', 'Pacific/Majuro'), ('Pacific/Marquesas', 'Pacific/Marquesas'), ('Pacific/Midway', 'Pacific/Midway'), ('Pacific/Nauru', 'Pacific/Nauru'), ('Pacific/Niue', 'Pacific/Niue'), ('Pacific/Norfolk', 'Pacific/Norfolk'), ('Pacific/Noumea', 'Pacific/Noumea'), ('Pacific/Pago_Pago', 'Pacific/Pago_Pago'), ('Pacific/Palau', 'Pacific/Palau'), ('Pacific/Pitcairn', 'Pacific/Pitcairn'), ('Pacific/Pohnpei', 'Pacific/Pohnpei'), ('Pacific/Ponape', 'Pacific/Ponape'), ('Pacific/Port_Moresby', 'Pacific/Port_Moresby'), ('Pacific/Rarotonga', 'Pacific/Rarotonga'), ('Pacific/Saipan', 'Pacific/Saipan'), ('Pacific/Samoa', 'Pacific/Samoa'), ('Pacific/Tahiti', 'Pacific/Tahiti'), ('Pacific/Tarawa', 'Pacific/Tarawa'), ('Pacific/Tongatapu', 'Pacific/Tongatapu'), ('Pacific/Truk', 'Pacific/Truk'), ('Pacific/Wake', 'Pacific/Wake'), ('Pacific/Wallis', 'Pacific/Wallis'), ('Pacific/Yap', 'Pacific/Yap'), ('Poland', 'Poland'), ('Portugal', 'Portugal'), ('ROC', 'ROC'), ('ROK', 'ROK'), ('Singapore', 'Singapore'), ('Turkey', 'Turkey'), ('UCT', 'UCT'), ('US/Alaska', 'US/Alaska'), ('US/Aleutian', 'US/Aleutian'), ('US/Arizona', 'US/Arizona'), ('US/Central', 'US/Central'), ('US/East-Indiana', 'US/East-Indiana'), ('US/Eastern', 'US/Eastern'), ('US/Hawaii', 'US/Hawaii'), ('US/Indiana-Starke', 'US/Indiana-Starke'), ('US/Michigan', 'US/Michigan'), ('US/Mountain', 'US/Mountain'), ('US/Pacific', 'US/Pacific'), ('US/Samoa', 'US/Samoa'), ('UTC', 'UTC'), ('Universal', 'Universal'), ('W-SU', 'W-SU'), ('WET', 'WET'), ('Zulu', 'Zulu')], default='UTC', max_length=63)), + ], + options={ + 'verbose_name': 'Настройки отеля', + 'verbose_name_plural': 'Настройки отеля', + }, + ), + migrations.CreateModel( + name='GlobalSystemSettings', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('system_name', models.CharField(help_text='Название системы', max_length=255)), + ('system_version', models.CharField(help_text='Версия системы', max_length=255)), + ('server_timezone', models.CharField(choices=[('Africa/Abidjan', 'Africa/Abidjan'), ('Africa/Accra', 'Africa/Accra'), ('Africa/Addis_Ababa', 'Africa/Addis_Ababa'), ('Africa/Algiers', 'Africa/Algiers'), ('Africa/Asmara', 'Africa/Asmara'), ('Africa/Asmera', 'Africa/Asmera'), ('Africa/Bamako', 'Africa/Bamako'), ('Africa/Bangui', 'Africa/Bangui'), ('Africa/Banjul', 'Africa/Banjul'), ('Africa/Bissau', 'Africa/Bissau'), ('Africa/Blantyre', 'Africa/Blantyre'), ('Africa/Brazzaville', 'Africa/Brazzaville'), ('Africa/Bujumbura', 'Africa/Bujumbura'), ('Africa/Cairo', 'Africa/Cairo'), ('Africa/Casablanca', 'Africa/Casablanca'), ('Africa/Ceuta', 'Africa/Ceuta'), ('Africa/Conakry', 'Africa/Conakry'), ('Africa/Dakar', 'Africa/Dakar'), ('Africa/Dar_es_Salaam', 'Africa/Dar_es_Salaam'), ('Africa/Djibouti', 'Africa/Djibouti'), ('Africa/Douala', 'Africa/Douala'), ('Africa/El_Aaiun', 'Africa/El_Aaiun'), ('Africa/Freetown', 'Africa/Freetown'), ('Africa/Gaborone', 'Africa/Gaborone'), ('Africa/Harare', 'Africa/Harare'), ('Africa/Johannesburg', 'Africa/Johannesburg'), ('Africa/Juba', 'Africa/Juba'), ('Africa/Kampala', 'Africa/Kampala'), ('Africa/Khartoum', 'Africa/Khartoum'), ('Africa/Kigali', 'Africa/Kigali'), ('Africa/Kinshasa', 'Africa/Kinshasa'), ('Africa/Lagos', 'Africa/Lagos'), ('Africa/Libreville', 'Africa/Libreville'), ('Africa/Lome', 'Africa/Lome'), ('Africa/Luanda', 'Africa/Luanda'), ('Africa/Lubumbashi', 'Africa/Lubumbashi'), ('Africa/Lusaka', 'Africa/Lusaka'), ('Africa/Malabo', 'Africa/Malabo'), ('Africa/Maputo', 'Africa/Maputo'), ('Africa/Maseru', 'Africa/Maseru'), ('Africa/Mbabane', 'Africa/Mbabane'), ('Africa/Mogadishu', 'Africa/Mogadishu'), ('Africa/Monrovia', 'Africa/Monrovia'), ('Africa/Nairobi', 'Africa/Nairobi'), ('Africa/Ndjamena', 'Africa/Ndjamena'), ('Africa/Niamey', 'Africa/Niamey'), ('Africa/Nouakchott', 'Africa/Nouakchott'), ('Africa/Ouagadougou', 'Africa/Ouagadougou'), ('Africa/Porto-Novo', 'Africa/Porto-Novo'), ('Africa/Sao_Tome', 'Africa/Sao_Tome'), ('Africa/Timbuktu', 'Africa/Timbuktu'), ('Africa/Tripoli', 'Africa/Tripoli'), ('Africa/Tunis', 'Africa/Tunis'), ('Africa/Windhoek', 'Africa/Windhoek'), ('America/Adak', 'America/Adak'), ('America/Anchorage', 'America/Anchorage'), ('America/Anguilla', 'America/Anguilla'), ('America/Antigua', 'America/Antigua'), ('America/Araguaina', 'America/Araguaina'), ('America/Argentina/Buenos_Aires', 'America/Argentina/Buenos_Aires'), ('America/Argentina/Catamarca', 'America/Argentina/Catamarca'), ('America/Argentina/ComodRivadavia', 'America/Argentina/ComodRivadavia'), ('America/Argentina/Cordoba', 'America/Argentina/Cordoba'), ('America/Argentina/Jujuy', 'America/Argentina/Jujuy'), ('America/Argentina/La_Rioja', 'America/Argentina/La_Rioja'), ('America/Argentina/Mendoza', 'America/Argentina/Mendoza'), ('America/Argentina/Rio_Gallegos', 'America/Argentina/Rio_Gallegos'), ('America/Argentina/Salta', 'America/Argentina/Salta'), ('America/Argentina/San_Juan', 'America/Argentina/San_Juan'), ('America/Argentina/San_Luis', 'America/Argentina/San_Luis'), ('America/Argentina/Tucuman', 'America/Argentina/Tucuman'), ('America/Argentina/Ushuaia', 'America/Argentina/Ushuaia'), ('America/Aruba', 'America/Aruba'), ('America/Asuncion', 'America/Asuncion'), ('America/Atikokan', 'America/Atikokan'), ('America/Atka', 'America/Atka'), ('America/Bahia', 'America/Bahia'), ('America/Bahia_Banderas', 'America/Bahia_Banderas'), ('America/Barbados', 'America/Barbados'), ('America/Belem', 'America/Belem'), ('America/Belize', 'America/Belize'), ('America/Blanc-Sablon', 'America/Blanc-Sablon'), ('America/Boa_Vista', 'America/Boa_Vista'), ('America/Bogota', 'America/Bogota'), ('America/Boise', 'America/Boise'), ('America/Buenos_Aires', 'America/Buenos_Aires'), ('America/Cambridge_Bay', 'America/Cambridge_Bay'), ('America/Campo_Grande', 'America/Campo_Grande'), ('America/Cancun', 'America/Cancun'), ('America/Caracas', 'America/Caracas'), ('America/Catamarca', 'America/Catamarca'), ('America/Cayenne', 'America/Cayenne'), ('America/Cayman', 'America/Cayman'), ('America/Chicago', 'America/Chicago'), ('America/Chihuahua', 'America/Chihuahua'), ('America/Ciudad_Juarez', 'America/Ciudad_Juarez'), ('America/Coral_Harbour', 'America/Coral_Harbour'), ('America/Cordoba', 'America/Cordoba'), ('America/Costa_Rica', 'America/Costa_Rica'), ('America/Creston', 'America/Creston'), ('America/Cuiaba', 'America/Cuiaba'), ('America/Curacao', 'America/Curacao'), ('America/Danmarkshavn', 'America/Danmarkshavn'), ('America/Dawson', 'America/Dawson'), ('America/Dawson_Creek', 'America/Dawson_Creek'), ('America/Denver', 'America/Denver'), ('America/Detroit', 'America/Detroit'), ('America/Dominica', 'America/Dominica'), ('America/Edmonton', 'America/Edmonton'), ('America/Eirunepe', 'America/Eirunepe'), ('America/El_Salvador', 'America/El_Salvador'), ('America/Ensenada', 'America/Ensenada'), ('America/Fort_Nelson', 'America/Fort_Nelson'), ('America/Fort_Wayne', 'America/Fort_Wayne'), ('America/Fortaleza', 'America/Fortaleza'), ('America/Glace_Bay', 'America/Glace_Bay'), ('America/Godthab', 'America/Godthab'), ('America/Goose_Bay', 'America/Goose_Bay'), ('America/Grand_Turk', 'America/Grand_Turk'), ('America/Grenada', 'America/Grenada'), ('America/Guadeloupe', 'America/Guadeloupe'), ('America/Guatemala', 'America/Guatemala'), ('America/Guayaquil', 'America/Guayaquil'), ('America/Guyana', 'America/Guyana'), ('America/Halifax', 'America/Halifax'), ('America/Havana', 'America/Havana'), ('America/Hermosillo', 'America/Hermosillo'), ('America/Indiana/Indianapolis', 'America/Indiana/Indianapolis'), ('America/Indiana/Knox', 'America/Indiana/Knox'), ('America/Indiana/Marengo', 'America/Indiana/Marengo'), ('America/Indiana/Petersburg', 'America/Indiana/Petersburg'), ('America/Indiana/Tell_City', 'America/Indiana/Tell_City'), ('America/Indiana/Vevay', 'America/Indiana/Vevay'), ('America/Indiana/Vincennes', 'America/Indiana/Vincennes'), ('America/Indiana/Winamac', 'America/Indiana/Winamac'), ('America/Indianapolis', 'America/Indianapolis'), ('America/Inuvik', 'America/Inuvik'), ('America/Iqaluit', 'America/Iqaluit'), ('America/Jamaica', 'America/Jamaica'), ('America/Jujuy', 'America/Jujuy'), ('America/Juneau', 'America/Juneau'), ('America/Kentucky/Louisville', 'America/Kentucky/Louisville'), ('America/Kentucky/Monticello', 'America/Kentucky/Monticello'), ('America/Knox_IN', 'America/Knox_IN'), ('America/Kralendijk', 'America/Kralendijk'), ('America/La_Paz', 'America/La_Paz'), ('America/Lima', 'America/Lima'), ('America/Los_Angeles', 'America/Los_Angeles'), ('America/Louisville', 'America/Louisville'), ('America/Lower_Princes', 'America/Lower_Princes'), ('America/Maceio', 'America/Maceio'), ('America/Managua', 'America/Managua'), ('America/Manaus', 'America/Manaus'), ('America/Marigot', 'America/Marigot'), ('America/Martinique', 'America/Martinique'), ('America/Matamoros', 'America/Matamoros'), ('America/Mazatlan', 'America/Mazatlan'), ('America/Mendoza', 'America/Mendoza'), ('America/Menominee', 'America/Menominee'), ('America/Merida', 'America/Merida'), ('America/Metlakatla', 'America/Metlakatla'), ('America/Mexico_City', 'America/Mexico_City'), ('America/Miquelon', 'America/Miquelon'), ('America/Moncton', 'America/Moncton'), ('America/Monterrey', 'America/Monterrey'), ('America/Montevideo', 'America/Montevideo'), ('America/Montreal', 'America/Montreal'), ('America/Montserrat', 'America/Montserrat'), ('America/Nassau', 'America/Nassau'), ('America/New_York', 'America/New_York'), ('America/Nipigon', 'America/Nipigon'), ('America/Nome', 'America/Nome'), ('America/Noronha', 'America/Noronha'), ('America/North_Dakota/Beulah', 'America/North_Dakota/Beulah'), ('America/North_Dakota/Center', 'America/North_Dakota/Center'), ('America/North_Dakota/New_Salem', 'America/North_Dakota/New_Salem'), ('America/Nuuk', 'America/Nuuk'), ('America/Ojinaga', 'America/Ojinaga'), ('America/Panama', 'America/Panama'), ('America/Pangnirtung', 'America/Pangnirtung'), ('America/Paramaribo', 'America/Paramaribo'), ('America/Phoenix', 'America/Phoenix'), ('America/Port-au-Prince', 'America/Port-au-Prince'), ('America/Port_of_Spain', 'America/Port_of_Spain'), ('America/Porto_Acre', 'America/Porto_Acre'), ('America/Porto_Velho', 'America/Porto_Velho'), ('America/Puerto_Rico', 'America/Puerto_Rico'), ('America/Punta_Arenas', 'America/Punta_Arenas'), ('America/Rainy_River', 'America/Rainy_River'), ('America/Rankin_Inlet', 'America/Rankin_Inlet'), ('America/Recife', 'America/Recife'), ('America/Regina', 'America/Regina'), ('America/Resolute', 'America/Resolute'), ('America/Rio_Branco', 'America/Rio_Branco'), ('America/Rosario', 'America/Rosario'), ('America/Santa_Isabel', 'America/Santa_Isabel'), ('America/Santarem', 'America/Santarem'), ('America/Santiago', 'America/Santiago'), ('America/Santo_Domingo', 'America/Santo_Domingo'), ('America/Sao_Paulo', 'America/Sao_Paulo'), ('America/Scoresbysund', 'America/Scoresbysund'), ('America/Shiprock', 'America/Shiprock'), ('America/Sitka', 'America/Sitka'), ('America/St_Barthelemy', 'America/St_Barthelemy'), ('America/St_Johns', 'America/St_Johns'), ('America/St_Kitts', 'America/St_Kitts'), ('America/St_Lucia', 'America/St_Lucia'), ('America/St_Thomas', 'America/St_Thomas'), ('America/St_Vincent', 'America/St_Vincent'), ('America/Swift_Current', 'America/Swift_Current'), ('America/Tegucigalpa', 'America/Tegucigalpa'), ('America/Thule', 'America/Thule'), ('America/Thunder_Bay', 'America/Thunder_Bay'), ('America/Tijuana', 'America/Tijuana'), ('America/Toronto', 'America/Toronto'), ('America/Tortola', 'America/Tortola'), ('America/Vancouver', 'America/Vancouver'), ('America/Virgin', 'America/Virgin'), ('America/Whitehorse', 'America/Whitehorse'), ('America/Winnipeg', 'America/Winnipeg'), ('America/Yakutat', 'America/Yakutat'), ('America/Yellowknife', 'America/Yellowknife'), ('Antarctica/Casey', 'Antarctica/Casey'), ('Antarctica/Davis', 'Antarctica/Davis'), ('Antarctica/DumontDUrville', 'Antarctica/DumontDUrville'), ('Antarctica/Macquarie', 'Antarctica/Macquarie'), ('Antarctica/Mawson', 'Antarctica/Mawson'), ('Antarctica/McMurdo', 'Antarctica/McMurdo'), ('Antarctica/Palmer', 'Antarctica/Palmer'), ('Antarctica/Rothera', 'Antarctica/Rothera'), ('Antarctica/South_Pole', 'Antarctica/South_Pole'), ('Antarctica/Syowa', 'Antarctica/Syowa'), ('Antarctica/Troll', 'Antarctica/Troll'), ('Antarctica/Vostok', 'Antarctica/Vostok'), ('Arctic/Longyearbyen', 'Arctic/Longyearbyen'), ('Asia/Aden', 'Asia/Aden'), ('Asia/Almaty', 'Asia/Almaty'), ('Asia/Amman', 'Asia/Amman'), ('Asia/Anadyr', 'Asia/Anadyr'), ('Asia/Aqtau', 'Asia/Aqtau'), ('Asia/Aqtobe', 'Asia/Aqtobe'), ('Asia/Ashgabat', 'Asia/Ashgabat'), ('Asia/Ashkhabad', 'Asia/Ashkhabad'), ('Asia/Atyrau', 'Asia/Atyrau'), ('Asia/Baghdad', 'Asia/Baghdad'), ('Asia/Bahrain', 'Asia/Bahrain'), ('Asia/Baku', 'Asia/Baku'), ('Asia/Bangkok', 'Asia/Bangkok'), ('Asia/Barnaul', 'Asia/Barnaul'), ('Asia/Beirut', 'Asia/Beirut'), ('Asia/Bishkek', 'Asia/Bishkek'), ('Asia/Brunei', 'Asia/Brunei'), ('Asia/Calcutta', 'Asia/Calcutta'), ('Asia/Chita', 'Asia/Chita'), ('Asia/Choibalsan', 'Asia/Choibalsan'), ('Asia/Chongqing', 'Asia/Chongqing'), ('Asia/Chungking', 'Asia/Chungking'), ('Asia/Colombo', 'Asia/Colombo'), ('Asia/Dacca', 'Asia/Dacca'), ('Asia/Damascus', 'Asia/Damascus'), ('Asia/Dhaka', 'Asia/Dhaka'), ('Asia/Dili', 'Asia/Dili'), ('Asia/Dubai', 'Asia/Dubai'), ('Asia/Dushanbe', 'Asia/Dushanbe'), ('Asia/Famagusta', 'Asia/Famagusta'), ('Asia/Gaza', 'Asia/Gaza'), ('Asia/Harbin', 'Asia/Harbin'), ('Asia/Hebron', 'Asia/Hebron'), ('Asia/Ho_Chi_Minh', 'Asia/Ho_Chi_Minh'), ('Asia/Hong_Kong', 'Asia/Hong_Kong'), ('Asia/Hovd', 'Asia/Hovd'), ('Asia/Irkutsk', 'Asia/Irkutsk'), ('Asia/Istanbul', 'Asia/Istanbul'), ('Asia/Jakarta', 'Asia/Jakarta'), ('Asia/Jayapura', 'Asia/Jayapura'), ('Asia/Jerusalem', 'Asia/Jerusalem'), ('Asia/Kabul', 'Asia/Kabul'), ('Asia/Kamchatka', 'Asia/Kamchatka'), ('Asia/Karachi', 'Asia/Karachi'), ('Asia/Kashgar', 'Asia/Kashgar'), ('Asia/Kathmandu', 'Asia/Kathmandu'), ('Asia/Katmandu', 'Asia/Katmandu'), ('Asia/Khandyga', 'Asia/Khandyga'), ('Asia/Kolkata', 'Asia/Kolkata'), ('Asia/Krasnoyarsk', 'Asia/Krasnoyarsk'), ('Asia/Kuala_Lumpur', 'Asia/Kuala_Lumpur'), ('Asia/Kuching', 'Asia/Kuching'), ('Asia/Kuwait', 'Asia/Kuwait'), ('Asia/Macao', 'Asia/Macao'), ('Asia/Macau', 'Asia/Macau'), ('Asia/Magadan', 'Asia/Magadan'), ('Asia/Makassar', 'Asia/Makassar'), ('Asia/Manila', 'Asia/Manila'), ('Asia/Muscat', 'Asia/Muscat'), ('Asia/Nicosia', 'Asia/Nicosia'), ('Asia/Novokuznetsk', 'Asia/Novokuznetsk'), ('Asia/Novosibirsk', 'Asia/Novosibirsk'), ('Asia/Omsk', 'Asia/Omsk'), ('Asia/Oral', 'Asia/Oral'), ('Asia/Phnom_Penh', 'Asia/Phnom_Penh'), ('Asia/Pontianak', 'Asia/Pontianak'), ('Asia/Pyongyang', 'Asia/Pyongyang'), ('Asia/Qatar', 'Asia/Qatar'), ('Asia/Qostanay', 'Asia/Qostanay'), ('Asia/Qyzylorda', 'Asia/Qyzylorda'), ('Asia/Rangoon', 'Asia/Rangoon'), ('Asia/Riyadh', 'Asia/Riyadh'), ('Asia/Saigon', 'Asia/Saigon'), ('Asia/Sakhalin', 'Asia/Sakhalin'), ('Asia/Samarkand', 'Asia/Samarkand'), ('Asia/Seoul', 'Asia/Seoul'), ('Asia/Shanghai', 'Asia/Shanghai'), ('Asia/Singapore', 'Asia/Singapore'), ('Asia/Srednekolymsk', 'Asia/Srednekolymsk'), ('Asia/Taipei', 'Asia/Taipei'), ('Asia/Tashkent', 'Asia/Tashkent'), ('Asia/Tbilisi', 'Asia/Tbilisi'), ('Asia/Tehran', 'Asia/Tehran'), ('Asia/Tel_Aviv', 'Asia/Tel_Aviv'), ('Asia/Thimbu', 'Asia/Thimbu'), ('Asia/Thimphu', 'Asia/Thimphu'), ('Asia/Tokyo', 'Asia/Tokyo'), ('Asia/Tomsk', 'Asia/Tomsk'), ('Asia/Ujung_Pandang', 'Asia/Ujung_Pandang'), ('Asia/Ulaanbaatar', 'Asia/Ulaanbaatar'), ('Asia/Ulan_Bator', 'Asia/Ulan_Bator'), ('Asia/Urumqi', 'Asia/Urumqi'), ('Asia/Ust-Nera', 'Asia/Ust-Nera'), ('Asia/Vientiane', 'Asia/Vientiane'), ('Asia/Vladivostok', 'Asia/Vladivostok'), ('Asia/Yakutsk', 'Asia/Yakutsk'), ('Asia/Yangon', 'Asia/Yangon'), ('Asia/Yekaterinburg', 'Asia/Yekaterinburg'), ('Asia/Yerevan', 'Asia/Yerevan'), ('Atlantic/Azores', 'Atlantic/Azores'), ('Atlantic/Bermuda', 'Atlantic/Bermuda'), ('Atlantic/Canary', 'Atlantic/Canary'), ('Atlantic/Cape_Verde', 'Atlantic/Cape_Verde'), ('Atlantic/Faeroe', 'Atlantic/Faeroe'), ('Atlantic/Faroe', 'Atlantic/Faroe'), ('Atlantic/Jan_Mayen', 'Atlantic/Jan_Mayen'), ('Atlantic/Madeira', 'Atlantic/Madeira'), ('Atlantic/Reykjavik', 'Atlantic/Reykjavik'), ('Atlantic/South_Georgia', 'Atlantic/South_Georgia'), ('Atlantic/St_Helena', 'Atlantic/St_Helena'), ('Atlantic/Stanley', 'Atlantic/Stanley'), ('Australia/ACT', 'Australia/ACT'), ('Australia/Adelaide', 'Australia/Adelaide'), ('Australia/Brisbane', 'Australia/Brisbane'), ('Australia/Broken_Hill', 'Australia/Broken_Hill'), ('Australia/Canberra', 'Australia/Canberra'), ('Australia/Currie', 'Australia/Currie'), ('Australia/Darwin', 'Australia/Darwin'), ('Australia/Eucla', 'Australia/Eucla'), ('Australia/Hobart', 'Australia/Hobart'), ('Australia/LHI', 'Australia/LHI'), ('Australia/Lindeman', 'Australia/Lindeman'), ('Australia/Lord_Howe', 'Australia/Lord_Howe'), ('Australia/Melbourne', 'Australia/Melbourne'), ('Australia/NSW', 'Australia/NSW'), ('Australia/North', 'Australia/North'), ('Australia/Perth', 'Australia/Perth'), ('Australia/Queensland', 'Australia/Queensland'), ('Australia/South', 'Australia/South'), ('Australia/Sydney', 'Australia/Sydney'), ('Australia/Tasmania', 'Australia/Tasmania'), ('Australia/Victoria', 'Australia/Victoria'), ('Australia/West', 'Australia/West'), ('Australia/Yancowinna', 'Australia/Yancowinna'), ('Brazil/Acre', 'Brazil/Acre'), ('Brazil/DeNoronha', 'Brazil/DeNoronha'), ('Brazil/East', 'Brazil/East'), ('Brazil/West', 'Brazil/West'), ('CET', 'CET'), ('CST6CDT', 'CST6CDT'), ('Canada/Atlantic', 'Canada/Atlantic'), ('Canada/Central', 'Canada/Central'), ('Canada/Eastern', 'Canada/Eastern'), ('Canada/Mountain', 'Canada/Mountain'), ('Canada/Newfoundland', 'Canada/Newfoundland'), ('Canada/Pacific', 'Canada/Pacific'), ('Canada/Saskatchewan', 'Canada/Saskatchewan'), ('Canada/Yukon', 'Canada/Yukon'), ('Chile/Continental', 'Chile/Continental'), ('Chile/EasterIsland', 'Chile/EasterIsland'), ('Cuba', 'Cuba'), ('EET', 'EET'), ('EST', 'EST'), ('EST5EDT', 'EST5EDT'), ('Egypt', 'Egypt'), ('Eire', 'Eire'), ('Etc/GMT', 'Etc/GMT'), ('Etc/GMT+0', 'Etc/GMT+0'), ('Etc/GMT+1', 'Etc/GMT+1'), ('Etc/GMT+10', 'Etc/GMT+10'), ('Etc/GMT+11', 'Etc/GMT+11'), ('Etc/GMT+12', 'Etc/GMT+12'), ('Etc/GMT+2', 'Etc/GMT+2'), ('Etc/GMT+3', 'Etc/GMT+3'), ('Etc/GMT+4', 'Etc/GMT+4'), ('Etc/GMT+5', 'Etc/GMT+5'), ('Etc/GMT+6', 'Etc/GMT+6'), ('Etc/GMT+7', 'Etc/GMT+7'), ('Etc/GMT+8', 'Etc/GMT+8'), ('Etc/GMT+9', 'Etc/GMT+9'), ('Etc/GMT-0', 'Etc/GMT-0'), ('Etc/GMT-1', 'Etc/GMT-1'), ('Etc/GMT-10', 'Etc/GMT-10'), ('Etc/GMT-11', 'Etc/GMT-11'), ('Etc/GMT-12', 'Etc/GMT-12'), ('Etc/GMT-13', 'Etc/GMT-13'), ('Etc/GMT-14', 'Etc/GMT-14'), ('Etc/GMT-2', 'Etc/GMT-2'), ('Etc/GMT-3', 'Etc/GMT-3'), ('Etc/GMT-4', 'Etc/GMT-4'), ('Etc/GMT-5', 'Etc/GMT-5'), ('Etc/GMT-6', 'Etc/GMT-6'), ('Etc/GMT-7', 'Etc/GMT-7'), ('Etc/GMT-8', 'Etc/GMT-8'), ('Etc/GMT-9', 'Etc/GMT-9'), ('Etc/GMT0', 'Etc/GMT0'), ('Etc/Greenwich', 'Etc/Greenwich'), ('Etc/UCT', 'Etc/UCT'), ('Etc/UTC', 'Etc/UTC'), ('Etc/Universal', 'Etc/Universal'), ('Etc/Zulu', 'Etc/Zulu'), ('Europe/Amsterdam', 'Europe/Amsterdam'), ('Europe/Andorra', 'Europe/Andorra'), ('Europe/Astrakhan', 'Europe/Astrakhan'), ('Europe/Athens', 'Europe/Athens'), ('Europe/Belfast', 'Europe/Belfast'), ('Europe/Belgrade', 'Europe/Belgrade'), ('Europe/Berlin', 'Europe/Berlin'), ('Europe/Bratislava', 'Europe/Bratislava'), ('Europe/Brussels', 'Europe/Brussels'), ('Europe/Bucharest', 'Europe/Bucharest'), ('Europe/Budapest', 'Europe/Budapest'), ('Europe/Busingen', 'Europe/Busingen'), ('Europe/Chisinau', 'Europe/Chisinau'), ('Europe/Copenhagen', 'Europe/Copenhagen'), ('Europe/Dublin', 'Europe/Dublin'), ('Europe/Gibraltar', 'Europe/Gibraltar'), ('Europe/Guernsey', 'Europe/Guernsey'), ('Europe/Helsinki', 'Europe/Helsinki'), ('Europe/Isle_of_Man', 'Europe/Isle_of_Man'), ('Europe/Istanbul', 'Europe/Istanbul'), ('Europe/Jersey', 'Europe/Jersey'), ('Europe/Kaliningrad', 'Europe/Kaliningrad'), ('Europe/Kiev', 'Europe/Kiev'), ('Europe/Kirov', 'Europe/Kirov'), ('Europe/Kyiv', 'Europe/Kyiv'), ('Europe/Lisbon', 'Europe/Lisbon'), ('Europe/Ljubljana', 'Europe/Ljubljana'), ('Europe/London', 'Europe/London'), ('Europe/Luxembourg', 'Europe/Luxembourg'), ('Europe/Madrid', 'Europe/Madrid'), ('Europe/Malta', 'Europe/Malta'), ('Europe/Mariehamn', 'Europe/Mariehamn'), ('Europe/Minsk', 'Europe/Minsk'), ('Europe/Monaco', 'Europe/Monaco'), ('Europe/Moscow', 'Europe/Moscow'), ('Europe/Nicosia', 'Europe/Nicosia'), ('Europe/Oslo', 'Europe/Oslo'), ('Europe/Paris', 'Europe/Paris'), ('Europe/Podgorica', 'Europe/Podgorica'), ('Europe/Prague', 'Europe/Prague'), ('Europe/Riga', 'Europe/Riga'), ('Europe/Rome', 'Europe/Rome'), ('Europe/Samara', 'Europe/Samara'), ('Europe/San_Marino', 'Europe/San_Marino'), ('Europe/Sarajevo', 'Europe/Sarajevo'), ('Europe/Saratov', 'Europe/Saratov'), ('Europe/Simferopol', 'Europe/Simferopol'), ('Europe/Skopje', 'Europe/Skopje'), ('Europe/Sofia', 'Europe/Sofia'), ('Europe/Stockholm', 'Europe/Stockholm'), ('Europe/Tallinn', 'Europe/Tallinn'), ('Europe/Tirane', 'Europe/Tirane'), ('Europe/Tiraspol', 'Europe/Tiraspol'), ('Europe/Ulyanovsk', 'Europe/Ulyanovsk'), ('Europe/Uzhgorod', 'Europe/Uzhgorod'), ('Europe/Vaduz', 'Europe/Vaduz'), ('Europe/Vatican', 'Europe/Vatican'), ('Europe/Vienna', 'Europe/Vienna'), ('Europe/Vilnius', 'Europe/Vilnius'), ('Europe/Volgograd', 'Europe/Volgograd'), ('Europe/Warsaw', 'Europe/Warsaw'), ('Europe/Zagreb', 'Europe/Zagreb'), ('Europe/Zaporozhye', 'Europe/Zaporozhye'), ('Europe/Zurich', 'Europe/Zurich'), ('GB', 'GB'), ('GB-Eire', 'GB-Eire'), ('GMT', 'GMT'), ('GMT+0', 'GMT+0'), ('GMT-0', 'GMT-0'), ('GMT0', 'GMT0'), ('Greenwich', 'Greenwich'), ('HST', 'HST'), ('Hongkong', 'Hongkong'), ('Iceland', 'Iceland'), ('Indian/Antananarivo', 'Indian/Antananarivo'), ('Indian/Chagos', 'Indian/Chagos'), ('Indian/Christmas', 'Indian/Christmas'), ('Indian/Cocos', 'Indian/Cocos'), ('Indian/Comoro', 'Indian/Comoro'), ('Indian/Kerguelen', 'Indian/Kerguelen'), ('Indian/Mahe', 'Indian/Mahe'), ('Indian/Maldives', 'Indian/Maldives'), ('Indian/Mauritius', 'Indian/Mauritius'), ('Indian/Mayotte', 'Indian/Mayotte'), ('Indian/Reunion', 'Indian/Reunion'), ('Iran', 'Iran'), ('Israel', 'Israel'), ('Jamaica', 'Jamaica'), ('Japan', 'Japan'), ('Kwajalein', 'Kwajalein'), ('Libya', 'Libya'), ('MET', 'MET'), ('MST', 'MST'), ('MST7MDT', 'MST7MDT'), ('Mexico/BajaNorte', 'Mexico/BajaNorte'), ('Mexico/BajaSur', 'Mexico/BajaSur'), ('Mexico/General', 'Mexico/General'), ('NZ', 'NZ'), ('NZ-CHAT', 'NZ-CHAT'), ('Navajo', 'Navajo'), ('PRC', 'PRC'), ('PST8PDT', 'PST8PDT'), ('Pacific/Apia', 'Pacific/Apia'), ('Pacific/Auckland', 'Pacific/Auckland'), ('Pacific/Bougainville', 'Pacific/Bougainville'), ('Pacific/Chatham', 'Pacific/Chatham'), ('Pacific/Chuuk', 'Pacific/Chuuk'), ('Pacific/Easter', 'Pacific/Easter'), ('Pacific/Efate', 'Pacific/Efate'), ('Pacific/Enderbury', 'Pacific/Enderbury'), ('Pacific/Fakaofo', 'Pacific/Fakaofo'), ('Pacific/Fiji', 'Pacific/Fiji'), ('Pacific/Funafuti', 'Pacific/Funafuti'), ('Pacific/Galapagos', 'Pacific/Galapagos'), ('Pacific/Gambier', 'Pacific/Gambier'), ('Pacific/Guadalcanal', 'Pacific/Guadalcanal'), ('Pacific/Guam', 'Pacific/Guam'), ('Pacific/Honolulu', 'Pacific/Honolulu'), ('Pacific/Johnston', 'Pacific/Johnston'), ('Pacific/Kanton', 'Pacific/Kanton'), ('Pacific/Kiritimati', 'Pacific/Kiritimati'), ('Pacific/Kosrae', 'Pacific/Kosrae'), ('Pacific/Kwajalein', 'Pacific/Kwajalein'), ('Pacific/Majuro', 'Pacific/Majuro'), ('Pacific/Marquesas', 'Pacific/Marquesas'), ('Pacific/Midway', 'Pacific/Midway'), ('Pacific/Nauru', 'Pacific/Nauru'), ('Pacific/Niue', 'Pacific/Niue'), ('Pacific/Norfolk', 'Pacific/Norfolk'), ('Pacific/Noumea', 'Pacific/Noumea'), ('Pacific/Pago_Pago', 'Pacific/Pago_Pago'), ('Pacific/Palau', 'Pacific/Palau'), ('Pacific/Pitcairn', 'Pacific/Pitcairn'), ('Pacific/Pohnpei', 'Pacific/Pohnpei'), ('Pacific/Ponape', 'Pacific/Ponape'), ('Pacific/Port_Moresby', 'Pacific/Port_Moresby'), ('Pacific/Rarotonga', 'Pacific/Rarotonga'), ('Pacific/Saipan', 'Pacific/Saipan'), ('Pacific/Samoa', 'Pacific/Samoa'), ('Pacific/Tahiti', 'Pacific/Tahiti'), ('Pacific/Tarawa', 'Pacific/Tarawa'), ('Pacific/Tongatapu', 'Pacific/Tongatapu'), ('Pacific/Truk', 'Pacific/Truk'), ('Pacific/Wake', 'Pacific/Wake'), ('Pacific/Wallis', 'Pacific/Wallis'), ('Pacific/Yap', 'Pacific/Yap'), ('Poland', 'Poland'), ('Portugal', 'Portugal'), ('ROC', 'ROC'), ('ROK', 'ROK'), ('Singapore', 'Singapore'), ('Turkey', 'Turkey'), ('UCT', 'UCT'), ('US/Alaska', 'US/Alaska'), ('US/Aleutian', 'US/Aleutian'), ('US/Arizona', 'US/Arizona'), ('US/Central', 'US/Central'), ('US/East-Indiana', 'US/East-Indiana'), ('US/Eastern', 'US/Eastern'), ('US/Hawaii', 'US/Hawaii'), ('US/Indiana-Starke', 'US/Indiana-Starke'), ('US/Michigan', 'US/Michigan'), ('US/Mountain', 'US/Mountain'), ('US/Pacific', 'US/Pacific'), ('US/Samoa', 'US/Samoa'), ('UTC', 'UTC'), ('Universal', 'Universal'), ('W-SU', 'W-SU'), ('WET', 'WET'), ('Zulu', 'Zulu')], default='UTC', max_length=63)), + ], + options={ + 'verbose_name': 'Настройки системы', + 'verbose_name_plural': 'Настройки системы', + }, + ), + migrations.CreateModel( + name='LocalDatabase', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, verbose_name='Имя базы данных')), + ('host', models.CharField(default='localhost', max_length=255, verbose_name='Хост базы данных')), + ('port', models.IntegerField(default=5432, verbose_name='Порт базы данных')), + ('user', models.CharField(max_length=255, verbose_name='Пользователь базы данных')), + ('database', models.CharField(max_length=255, verbose_name='Название базы данных')), + ('password', models.CharField(max_length=255, verbose_name='Пароль базы данных')), + ('is_active', models.BooleanField(default=True, verbose_name='Активна ли база данных')), + ], + options={ + 'verbose_name': 'База данных', + 'verbose_name_plural': 'Базы данных', + }, + ), + migrations.CreateModel( + name='TelegramSettings', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('bot_token', models.CharField(help_text='Токен вашего бота Telegram', max_length=255)), + ('chat_id', models.CharField(help_text='ID чата для отправки сообщений', max_length=255)), + ('username', models.CharField(blank=True, help_text='Имя пользователя для бота', max_length=255, null=True)), + ], + options={ + 'verbose_name': 'Telegram', + 'verbose_name_plural': 'Telegram', + }, + ), + ] diff --git a/app_settings/migrations/__init__.py b/app_settings/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app_settings/models.py b/app_settings/models.py new file mode 100644 index 00000000..08922e13 --- /dev/null +++ b/app_settings/models.py @@ -0,0 +1,77 @@ +from django.db import models +import pytz + +class LocalDatabase(models.Model): + name = models.CharField(max_length=255, verbose_name="Имя базы данных") + host = models.CharField(max_length=255, verbose_name="Хост базы данных", default="localhost") + port = models.IntegerField(default=5432, verbose_name="Порт базы данных") + user = models.CharField(max_length=255, verbose_name="Пользователь базы данных") + database = models.CharField(max_length=255, verbose_name="Название базы данных") + password = models.CharField(max_length=255, verbose_name="Пароль базы данных") + is_active = models.BooleanField(default=True, verbose_name="Активна ли база данных") + + def __str__(self): + return self.name + + class Meta: + verbose_name = "База данных" + verbose_name_plural = "Базы данных" + +class TelegramSettings(models.Model): + bot_token = models.CharField(max_length=255, help_text="Токен вашего бота Telegram") + chat_id = models.CharField(max_length=255, help_text="ID чата для отправки сообщений") + username = models.CharField(max_length=255, help_text="Имя пользователя для бота", blank=True, null=True) + + def __str__(self): + return f"Telegram Bot ({self.username})" + + class Meta: + verbose_name = "Telegram" + verbose_name_plural = "Telegram" + +class EmailSettings(models.Model): + smtp_server = models.CharField(max_length=255, help_text="SMTP сервер для отправки почты") + smtp_port = models.IntegerField(default=587, help_text="SMTP порт для почты") + smtp_user = models.CharField(max_length=255, help_text="Имя пользователя для SMTP") + smtp_password = models.CharField(max_length=255, help_text="Пароль для SMTP") + from_email = models.EmailField(help_text="Email для отправки сообщений") + + class Meta: + verbose_name = "E-mail" + verbose_name_plural = "E-mails" + + def __str__(self): + return f"Email Settings for {self.from_email}" + +class GlobalHotelSettings(models.Model): + check_in_time = models.TimeField(help_text="Время заезда") + check_out_time = models.TimeField(help_text="Время выезда") + currency = models.CharField(max_length=3, help_text="Валюта") + global_timezone = models.CharField( + max_length=63, + choices=[(tz, tz) for tz in pytz.all_timezones], + default='UTC', + ) + + def __str__(self): + return "Настройки отеля" + + class Meta: + verbose_name = "Настройки отеля" + verbose_name_plural = "Настройки отеля" + +class GlobalSystemSettings(models.Model): + system_name = models.CharField(max_length=255, help_text="Название системы") + system_version = models.CharField(max_length=255, help_text="Версия системы") + server_timezone = models.CharField( + max_length=63, + choices=[(tz, tz) for tz in pytz.all_timezones], + default='UTC', + ) + + def __str__(self): + return "Настройки системы" + + class Meta: + verbose_name = "Настройки системы" + verbose_name_plural = "Настройки системы" diff --git a/app_settings/signals.py b/app_settings/signals.py new file mode 100644 index 00000000..d3dd3ea7 --- /dev/null +++ b/app_settings/signals.py @@ -0,0 +1,9 @@ +from django.db.models.signals import post_save +from django.dispatch import receiver +from .models import GlobalSystemSettings + +@receiver(post_save, sender=GlobalSystemSettings) +def update_system_settings(sender, instance, **kwargs): + # Безопасное использование сигнала + if instance: + print(f"Настройки системы обновлены: {instance.system_name}") \ No newline at end of file diff --git a/app_settings/tests.py b/app_settings/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/app_settings/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/app_settings/urls.py b/app_settings/urls.py new file mode 100644 index 00000000..26caeb71 --- /dev/null +++ b/app_settings/urls.py @@ -0,0 +1,11 @@ +from django.urls import path +from django.http import HttpResponse + +app_name = 'settings' + +def placeholder_view(request): + return HttpResponse("Placeholder for settings app.") + +urlpatterns = [ + path('', placeholder_view, name='settings_placeholder'), +] diff --git a/app_settings/views.py b/app_settings/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/app_settings/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..c3371d42 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,73 @@ +version: '3.9' + +services: + mysql: + image: mysql:8.0 + container_name: mysql + environment: + MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} + MYSQL_DATABASE: ${DB_NAME} + MYSQL_USER: ${DB_USER} + MYSQL_PASSWORD: ${DB_PASSWORD} + TMPDIR: /var/tmp + ports: + - "${DB_PORT}:3306" + volumes: + - mysql_data:/var/lib/mysql + - /var/tmp:/var/tmp + + django-admin: + build: + context: . + dockerfile: .docker/admin/Dockerfile + container_name: django-admin + restart: on-failure + volumes: + - .:/app + env_file: + - .env + environment: + - DJANGO_SETTINGS_MODULE=touchh.settings + - DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME} + - LOG_LEVEL=${LOG_LEVEL} + depends_on: + - mysql + ports: + - "8000:8000" + command: python manage.py runserver 0.0.0.0:8000 + + bot: + build: + context: . + dockerfile: .docker/bot/Dockerfile + container_name: bot + restart: on-failure + volumes: + - .:/app + environment: + - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN} + - DJANGO_SETTINGS_MODULE=project.settings + - DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME} + - LOG_LEVEL=${LOG_LEVEL} + depends_on: + - mysql + + scheduler: + build: + context: . + dockerfile: .docker/scheduler/Dockerfile + container_name: scheduler + restart: on-failure + volumes: + - .:/app + env_file: + - .env + environment: + - DJANGO_SETTINGS_MODULE=project.settings + - DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME} + - SCHEDULED_SYNC_LOG_LEVEL=${SCHEDULED_SYNC_LOG_LEVEL} + depends_on: + - mysql + +volumes: + mysql_data: \ No newline at end of file diff --git a/req1.txt b/req1.txt new file mode 100644 index 00000000..e935f179 --- /dev/null +++ b/req1.txt @@ -0,0 +1,65 @@ +ace_tools==0.0 +aiohappyeyeballs==2.4.4 +aiohttp==3.11.11 +aiosignal==1.3.2 +anyio==4.7.0 +APScheduler==3.11.0 +asgiref==3.8.1 +async-timeout==5.0.1 +attrs==24.3.0 +certifi==2024.12.14 +cffi==1.17.1 +charset-normalizer==3.4.0 +cryptography==44.0.0 +defusedxml==0.7.1 +Django==5.1.4 +django-environ==0.11.2 +django-extensions==3.2.3 +django-filter==24.3 +django-health-check==3.18.3 +django-jazzmin==3.0.1 +django-jet==1.0.8 +et_xmlfile==2.0.0 +exceptiongroup==1.2.2 +fonttools==4.55.3 +fpdf2==2.8.2 +frozenlist==1.5.0 +geoip2==4.8.1 +git-filter-repo==2.47.0 +h11==0.14.0 +httpcore==1.0.7 +httpx==0.28.1 +idna==3.10 +jsonschema==4.23.0 +jsonschema-specifications==2024.10.1 +maxminddb==2.6.2 +multidict==6.1.0 +numpy==2.2.0 +openpyxl==3.1.5 +pandas==2.2.3 +pathspec==0.12.1 +pillow==11.0.0 +propcache==0.2.1 +psycopg==3.2.3 +pycparser==2.22 +PyMySQL==1.1.1 +python-dateutil==2.9.0.post0 +python-decouple==3.8 +python-dotenv==1.0.1 +python-telegram-bot==21.9 +pytz==2024.2 +PyYAML==6.0.2 +referencing==0.35.1 +requests==2.32.3 +rpds-py==0.22.3 +six==1.17.0 +sniffio==1.3.1 +sqlparse==0.5.3 +typing_extensions==4.12.2 +tzdata==2024.2 +tzlocal==5.2 +ua-parser==1.0.0 +ua-parser-builtins==0.18.0.post1 +urllib3==2.2.3 +user-agents==2.2.0 +yarl==1.18.3 diff --git a/scheduler/management/commands/__init__.py b/scheduler/management/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/scheduler/management/commands/run_scheduler.py b/scheduler/management/commands/run_scheduler.py new file mode 100644 index 00000000..93930708 --- /dev/null +++ b/scheduler/management/commands/run_scheduler.py @@ -0,0 +1,27 @@ +import os +import django +import asyncio +from django.core.management.base import BaseCommand +from scheduler.tasks import setup_scheduler + + +class Command(BaseCommand): + help = "Запуск планировщика задач" + + def handle(self, *args, **options): + # Устанавливаем Django окружение + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "touchh.settings") + django.setup() + + # Основная асинхронная функция + async def start_scheduler(): + scheduler = await setup_scheduler() + self.stdout.write(self.style.SUCCESS("Планировщик задач успешно запущен.")) + try: + while True: + await asyncio.sleep(3600) # Бесконечный цикл для поддержания работы + except asyncio.CancelledError: + scheduler.shutdown() + + # Запускаем планировщик в асинхронном режиме + asyncio.run(start_scheduler()) diff --git a/scheduler/migrations/0002_alter_scheduledtask_function_path.py b/scheduler/migrations/0002_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..68524430 --- /dev/null +++ b/scheduler/migrations/0002_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-20 10:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('settings.views.render', 'render'), ('settings.urls.placeholder_view', 'placeholder_view'), ('settings.settings.load_database_settings', 'load_database_settings'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0003_alter_scheduledtask_function_path.py b/scheduler/migrations/0003_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..ebd44f0d --- /dev/null +++ b/scheduler/migrations/0003_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-20 11:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0002_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0004_alter_scheduledtask_function_path.py b/scheduler/migrations/0004_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..fee39f19 --- /dev/null +++ b/scheduler/migrations/0004_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-20 11:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0003_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('app_settings.settings.load_database_settings', 'load_database_settings'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0005_alter_scheduledtask_function_path.py b/scheduler/migrations/0005_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..fb5110ec --- /dev/null +++ b/scheduler/migrations/0005_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-20 11:18 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0004_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('app_settings.settings.load_database_settings', 'load_database_settings'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0006_alter_scheduledtask_function_path.py b/scheduler/migrations/0006_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..55919c98 --- /dev/null +++ b/scheduler/migrations/0006_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-20 11:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0005_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0007_alter_scheduledtask_function_path.py b/scheduler/migrations/0007_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..44a83c99 --- /dev/null +++ b/scheduler/migrations/0007_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-20 11:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0006_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.app_settings.load_database_settings', 'load_database_settings'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0008_alter_scheduledtask_function_path.py b/scheduler/migrations/0008_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..cc5ccd01 --- /dev/null +++ b/scheduler/migrations/0008_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-20 12:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0007_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0009_alter_scheduledtask_function_path.py b/scheduler/migrations/0009_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..8dc8fe5f --- /dev/null +++ b/scheduler/migrations/0009_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-20 12:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0008_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.app_settings.load_database_settings', 'load_database_settings'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0010_alter_scheduledtask_function_path.py b/scheduler/migrations/0010_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..3a86cf51 --- /dev/null +++ b/scheduler/migrations/0010_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-21 01:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0009_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0011_alter_scheduledtask_function_path.py b/scheduler/migrations/0011_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..aceb687c --- /dev/null +++ b/scheduler/migrations/0011_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.17 on 2024-12-21 06:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0010_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.app_settings.load_database_settings', 'load_database_settings'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0012_alter_scheduledtask_function_path.py b/scheduler/migrations/0012_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..d236bfe4 --- /dev/null +++ b/scheduler/migrations/0012_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.17 on 2024-12-21 12:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0011_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('hotels.admin.format_html', 'format_html'), ('hotels.admin.redirect', 'redirect'), ('app_settings.app_settings.load_database_settings', 'load_database_settings'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.configure_logging', 'configure_logging'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.task_loader.execute_function', 'execute_function'), ('scheduler.task_loader.get_project_functions', 'get_project_functions'), ('scheduler.task_loader.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.task_loader.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.urls.placeholder_view', 'placeholder_view'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/migrations/0013_alter_scheduledtask_function_path.py b/scheduler/migrations/0013_alter_scheduledtask_function_path.py new file mode 100644 index 00000000..e5845cfb --- /dev/null +++ b/scheduler/migrations/0013_alter_scheduledtask_function_path.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.17 on 2024-12-21 12:44 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('scheduler', '0012_alter_scheduledtask_function_path'), + ] + + operations = [ + migrations.AlterField( + model_name='scheduledtask', + name='function_path', + field=models.CharField(choices=[('manage.main', 'main'), ('users.views.render', 'render'), ('bot.handlers.check_pms', 'check_pms'), ('bot.handlers.delete_hotel', 'delete_hotel'), ('bot.handlers.generate_statistics', 'generate_statistics'), ('bot.handlers.handle_button_click', 'handle_button_click'), ('bot.handlers.hotel_actions', 'hotel_actions'), ('bot.handlers.manage_hotels', 'manage_hotels'), ('bot.handlers.navigate_back', 'navigate_back'), ('bot.handlers.set_notification_time', 'set_notification_time'), ('bot.handlers.settings_menu', 'settings_menu'), ('bot.handlers.setup_rooms', 'setup_rooms'), ('bot.handlers.show_current_settings', 'show_current_settings'), ('bot.handlers.show_users', 'show_users'), ('bot.handlers.start', 'start'), ('bot.handlers.statistics', 'statistics'), ('bot.handlers.stats_select_period', 'stats_select_period'), ('bot.handlers.sync_hotel_data', 'sync_hotel_data'), ('bot.handlers.toggle_email', 'toggle_email'), ('bot.handlers.toggle_telegram', 'toggle_telegram'), ('bot.log_processor.analyze_logs', 'analyze_logs'), ('bot.log_processor.generate_statistics', 'generate_statistics'), ('bot.log_processor.get_geolocation', 'get_geolocation'), ('bot.log_processor.get_user_agent_details', 'get_user_agent_details'), ('bot.log_processor.parse', 'parse'), ('bot.views.render', 'render'), ('bot.keyboards.main_menu_keyboard', 'main_menu_keyboard'), ('bot.keyboards.stats_period_keyboard', 'stats_period_keyboard'), ('bot.utils.pdf_report.ensure_datetime', 'ensure_datetime'), ('bot.utils.pdf_report.generate_pdf_report', 'generate_pdf_report'), ('bot.utils.pdf_report.is_aware', 'is_aware'), ('bot.utils.pdf_report.is_naive', 'is_naive'), ('bot.utils.pdf_report.make_aware', 'make_aware'), ('bot.utils.pdf_report.sync_to_async', 'sync_to_async'), ('bot.utils.froud_check.detect_fraud', 'detect_fraud'), ('bot.utils.froud_check.sync_to_async', 'sync_to_async'), ('bot.utils.bot_setup.check_pms', 'check_pms'), ('bot.utils.bot_setup.delete_hotel', 'delete_hotel'), ('bot.utils.bot_setup.generate_statistics', 'generate_statistics'), ('bot.utils.bot_setup.handle_button_click', 'handle_button_click'), ('bot.utils.bot_setup.handle_notification_time', 'handle_notification_time'), ('bot.utils.bot_setup.hotel_actions', 'hotel_actions'), ('bot.utils.bot_setup.manage_hotels', 'manage_hotels'), ('bot.utils.bot_setup.set_notification_time', 'set_notification_time'), ('bot.utils.bot_setup.settings_menu', 'settings_menu'), ('bot.utils.bot_setup.setup_bot', 'setup_bot'), ('bot.utils.bot_setup.setup_rooms', 'setup_rooms'), ('bot.utils.bot_setup.show_current_settings', 'show_current_settings'), ('bot.utils.bot_setup.show_users', 'show_users'), ('bot.utils.bot_setup.start', 'start'), ('bot.utils.bot_setup.statistics', 'statistics'), ('bot.utils.bot_setup.stats_select_period', 'stats_select_period'), ('bot.utils.bot_setup.toggle_email', 'toggle_email'), ('bot.utils.bot_setup.toggle_telegram', 'toggle_telegram'), ('bot.utils.notifications.send_email_notification', 'send_email_notification'), ('bot.utils.notifications.send_mail', 'send_mail'), ('bot.utils.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.utils.scheduler.schedule_notifications', 'schedule_notifications'), ('bot.utils.scheduler.setup_scheduler', 'setup_scheduler'), ('bot.utils.database.get_hotel_by_id', 'get_hotel_by_id'), ('bot.utils.database.get_hotel_by_name', 'get_hotel_by_name'), ('bot.utils.database.get_hotels_for_user', 'get_hotels_for_user'), ('bot.utils.database.get_reservations', 'get_reservations'), ('bot.utils.database.get_user_from_chat_id', 'get_user_from_chat_id'), ('bot.utils.database.save_reservations', 'save_reservations'), ('bot.utils.database.sync_to_async', 'sync_to_async'), ('bot.operations.statistics.ensure_datetime', 'ensure_datetime'), ('bot.operations.statistics.generate_pdf_report', 'generate_pdf_report'), ('bot.operations.statistics.generate_statistics', 'generate_statistics'), ('bot.operations.statistics.get_hotel_by_name', 'get_hotel_by_name'), ('bot.operations.statistics.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.statistics.get_period_dates', 'get_period_dates'), ('bot.operations.statistics.is_aware', 'is_aware'), ('bot.operations.statistics.is_naive', 'is_naive'), ('bot.operations.statistics.make_aware', 'make_aware'), ('bot.operations.statistics.statistics', 'statistics'), ('bot.operations.statistics.stats_back', 'stats_back'), ('bot.operations.statistics.stats_select_period', 'stats_select_period'), ('bot.operations.statistics.sync_to_async', 'sync_to_async'), ('bot.operations.notifications.handle_notification_time', 'handle_notification_time'), ('bot.operations.notifications.schedule_notifications', 'schedule_notifications'), ('bot.operations.notifications.send_email_notification', 'send_email_notification'), ('bot.operations.notifications.send_mail', 'send_mail'), ('bot.operations.notifications.send_telegram_notification', 'send_telegram_notification'), ('bot.operations.notifications.sync_to_async', 'sync_to_async'), ('bot.operations.hotels.check_pms', 'check_pms'), ('bot.operations.hotels.delete_hotel', 'delete_hotel'), ('bot.operations.hotels.detect_fraud', 'detect_fraud'), ('bot.operations.hotels.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.hotels.handle_fraud_check', 'handle_fraud_check'), ('bot.operations.hotels.hotel_actions', 'hotel_actions'), ('bot.operations.hotels.manage_hotels', 'manage_hotels'), ('bot.operations.hotels.setup_rooms', 'setup_rooms'), ('bot.operations.hotels.sync_to_async', 'sync_to_async'), ('bot.operations.froud_notify.notify_fraud', 'notify_fraud'), ('bot.operations.users.delete_user', 'delete_user'), ('bot.operations.users.edit_user', 'edit_user'), ('bot.operations.users.get_hotels_for_user', 'get_hotels_for_user'), ('bot.operations.users.get_users_for_hotel', 'get_users_for_hotel'), ('bot.operations.users.show_user_hotels', 'show_user_hotels'), ('bot.operations.users.show_users', 'show_users'), ('bot.operations.users.show_users_in_hotel', 'show_users_in_hotel'), ('bot.operations.users.sync_to_async', 'sync_to_async'), ('bot.operations.users.user_action_menu', 'user_action_menu'), ('bot.operations.settings.set_notification_time', 'set_notification_time'), ('bot.operations.settings.settings_menu', 'settings_menu'), ('bot.operations.settings.show_current_settings', 'show_current_settings'), ('bot.operations.settings.sync_to_async', 'sync_to_async'), ('bot.operations.settings.toggle_email', 'toggle_email'), ('bot.operations.settings.toggle_telegram', 'toggle_telegram'), ('bot.management.commands.run_bot.setup_bot', 'setup_bot'), ('hotels.pms_check.sync_to_async', 'sync_to_async'), ('hotels.views.render', 'render'), ('hotels.pms_parse.parse_pms_data', 'parse_pms_data'), ('app_settings.app_settings.load_database_settings', 'load_database_settings'), ('app_settings.signals.receiver', 'receiver'), ('app_settings.signals.update_system_settings', 'update_system_settings'), ('app_settings.views.render', 'render'), ('app_settings.urls.placeholder_view', 'placeholder_view'), ('antifroud.models.unescape', 'unescape'), ('antifroud.models.unquote', 'unquote'), ('antifroud.data_sync.parse_qs', 'parse_qs'), ('antifroud.data_sync.scheduled_sync', 'scheduled_sync'), ('antifroud.data_sync.unquote', 'unquote'), ('antifroud.check_fraud.parse_qs', 'parse_qs'), ('antifroud.check_fraud.run_reservation_check', 'run_reservation_check'), ('antifroud.views.csrf_exempt', 'csrf_exempt'), ('antifroud.views.import_hotels', 'import_hotels'), ('antifroud.views.import_selected_hotels', 'import_selected_hotels'), ('antifroud.views.login_required', 'login_required'), ('antifroud.views.redirect', 'redirect'), ('antifroud.views.render', 'render'), ('antifroud.views.staff_member_required', 'staff_member_required'), ('antifroud.views.sync_log_create', 'sync_log_create'), ('antifroud.urls.placeholder_view', 'placeholder_view'), ('antifroud.admin.get_object_or_404', 'get_object_or_404'), ('antifroud.admin.import_selected_hotels', 'import_selected_hotels'), ('antifroud.admin.redirect', 'redirect'), ('antifroud.admin.reverse', 'reverse'), ('pms_integration.manager.sync_to_async', 'sync_to_async'), ('pms_integration.utils.get_all_plugins', 'get_all_plugins'), ('pms_integration.views.render', 'render'), ('pms_integration.admin.format_html', 'format_html'), ('pms_integration.admin.render', 'render'), ('pms_integration.admin.reverse', 'reverse'), ('pms_integration.plugins.realtycalendar_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.shelter_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.bnovo_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.ecvi_pms.sync_to_async', 'sync_to_async'), ('pms_integration.plugins.base_plugin.abstractmethod', 'abstractmethod'), ('touchh.urls.include', 'include'), ('touchh.settings.configure_logging', 'configure_logging'), ('touchh.settings.load_dotenv', 'load_dotenv'), ('touchh.utils.log.load_dotenv', 'load_dotenv'), ('scheduler.models.get_available_functions', 'get_available_functions'), ('scheduler.models.now', 'now'), ('scheduler.test_module.test_function', 'test_function'), ('scheduler.utils.execute_function', 'execute_function'), ('scheduler.utils.get_project_functions', 'get_project_functions'), ('scheduler.utils.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.utils.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.task_loader.execute_function', 'execute_function'), ('scheduler.task_loader.get_project_functions', 'get_project_functions'), ('scheduler.task_loader.load_gitignore_patterns', 'load_gitignore_patterns'), ('scheduler.task_loader.reload_tasks_periodically', 'reload_tasks_periodically'), ('scheduler.views.render', 'render'), ('scheduler.tasks.import_module', 'import_module'), ('scheduler.tasks.load_tasks_to_scheduler', 'load_tasks_to_scheduler'), ('scheduler.tasks.reload_tasks', 'reload_tasks'), ('scheduler.tasks.schedule_task_reloader', 'schedule_task_reloader'), ('scheduler.tasks.setup_scheduler', 'setup_scheduler'), ('scheduler.tasks.sync_to_async', 'sync_to_async'), ('scheduler.urls.placeholder_view', 'placeholder_view'), ('scheduler.management.commands.run_scheduler.setup_scheduler', 'setup_scheduler')], max_length=500, verbose_name='Путь к функции (модуль.функция)'), + ), + ] diff --git a/scheduler/task_loader.py b/scheduler/task_loader.py new file mode 100644 index 00000000..eba8a5bf --- /dev/null +++ b/scheduler/task_loader.py @@ -0,0 +1,95 @@ +import os +import inspect +import importlib +import asyncio +import logging +from typing import List, Tuple +from pathspec import PathSpec +from apscheduler.schedulers.asyncio import AsyncIOScheduler + +# Настройка логирования +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +def reload_tasks_periodically(scheduler: AsyncIOScheduler): + """Перезагрузка задач из базы данных каждые 5 минут.""" + async def reload(): + from scheduler.tasks import load_tasks_to_scheduler + try: + await load_tasks_to_scheduler(scheduler) + logger.info("Задачи успешно перезагружены.") + except Exception as e: + logger.error(f"Ошибка перезагрузки задач: {e}") + + scheduler.add_job(lambda: asyncio.run(reload()), "interval", minutes=5) + +def load_gitignore_patterns(project_root: str) -> PathSpec: + """ + Загружает паттерны из файла .gitignore. + """ + gitignore_path = os.path.join(project_root, ".gitignore") + try: + if os.path.exists(gitignore_path): + with open(gitignore_path, "r", encoding="utf-8") as f: + patterns = f.readlines() + return PathSpec.from_lines("gitwildmatch", patterns) + except Exception as e: + logger.warning(f"Ошибка загрузки .gitignore: {e}") + return PathSpec.from_lines("gitwildmatch", []) + +def get_project_functions() -> List[Tuple[str, str]]: + """ + Сканирует проект и возвращает список всех функций в формате (путь, имя функции), + исключая файлы и папки, указанные в .gitignore. + """ + functions = [] + project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + # Загружаем паттерны из .gitignore + gitignore_spec = load_gitignore_patterns(project_root) + + for root, dirs, files in os.walk(project_root): + # Исключаем директории, указанные в .gitignore + dirs[:] = [d for d in dirs if not gitignore_spec.match_file(os.path.relpath(os.path.join(root, d), project_root))] + + for file in files: + file_path = os.path.relpath(os.path.join(root, file), project_root) + if ( + file.endswith(".py") and + not file.startswith("__") and + not gitignore_spec.match_file(file_path) + ): + module_path = os.path.relpath(os.path.join(root, file), project_root) + module_name = module_path.replace(os.sep, ".").replace(".py", "") + + try: + spec = importlib.util.find_spec(module_name) + if spec is not None: + module = importlib.import_module(module_name) + for name, func in inspect.getmembers(module, inspect.isfunction): + functions.append((f"{module_name}.{name}", name)) + except Exception as e: + logger.error(f"Ошибка при обработке модуля {module_name}: {e}") + + return functions + +def execute_function(function_path: str): + """ + Выполняет функцию по указанному пути. + """ + try: + module_name, func_name = function_path.rsplit(".", 1) + spec = importlib.util.find_spec(module_name) + if spec is None: + raise ImportError(f"Модуль {module_name} не найден") + + module = importlib.import_module(module_name) + if not hasattr(module, func_name): + raise AttributeError(f"Функция {func_name} отсутствует в модуле {module_name}") + + func = getattr(module, func_name) + logger.info(f"Выполняется функция: {function_path}") + return func() + except Exception as e: + logger.error(f"Ошибка выполнения функции {function_path}: {e}") + return None diff --git a/scheduler/urls.py b/scheduler/urls.py new file mode 100644 index 00000000..995b8e5c --- /dev/null +++ b/scheduler/urls.py @@ -0,0 +1,14 @@ +from django.urls import path +from django.http import HttpResponse + +def placeholder_view(request): + """ + Заглушка для URL-адресов приложения scheduler. + """ + return HttpResponse("Это заглушка для приложения scheduler.") + +app_name = "scheduler" + +urlpatterns = [ + path("", placeholder_view, name="scheduler_placeholder"), +] diff --git a/staticfiles/admin/js/collapse.js b/staticfiles/admin/js/collapse.js new file mode 100644 index 00000000..c6c7b0f6 --- /dev/null +++ b/staticfiles/admin/js/collapse.js @@ -0,0 +1,43 @@ +/*global gettext*/ +'use strict'; +{ + window.addEventListener('load', function() { + // Add anchor tag for Show/Hide link + const fieldsets = document.querySelectorAll('fieldset.collapse'); + for (const [i, elem] of fieldsets.entries()) { + // Don't hide if fields in this fieldset have errors + if (elem.querySelectorAll('div.errors, ul.errorlist').length === 0) { + elem.classList.add('collapsed'); + const h2 = elem.querySelector('h2'); + const link = document.createElement('a'); + link.id = 'fieldsetcollapser' + i; + link.className = 'collapse-toggle'; + link.href = '#'; + link.textContent = gettext('Show'); + h2.appendChild(document.createTextNode(' (')); + h2.appendChild(link); + h2.appendChild(document.createTextNode(')')); + } + } + // Add toggle to hide/show anchor tag + const toggleFunc = function(ev) { + if (ev.target.matches('.collapse-toggle')) { + ev.preventDefault(); + ev.stopPropagation(); + const fieldset = ev.target.closest('fieldset'); + if (fieldset.classList.contains('collapsed')) { + // Show + ev.target.textContent = gettext('Hide'); + fieldset.classList.remove('collapsed'); + } else { + // Hide + ev.target.textContent = gettext('Show'); + fieldset.classList.add('collapsed'); + } + } + }; + document.querySelectorAll('fieldset.module').forEach(function(el) { + el.addEventListener('click', toggleFunc); + }); + }); +}