diff --git a/apps/main/tasks.py b/apps/main/tasks.py index b1991bd..8f01b2a 100644 --- a/apps/main/tasks.py +++ b/apps/main/tasks.py @@ -1,8 +1,6 @@ import decimal import traceback from datetime import datetime - -import pytz from dateutil.relativedelta import relativedelta import psycopg2 @@ -11,10 +9,9 @@ from celery import shared_task from django.db.models.functions import TruncMinute from django.utils import timezone -from sabron.util import logging - from apps.main.models.scales_control import ScalesControl from apps.main.models.worktime import FabricWorkTime +from sabron.util import logging from sabron.util.sabronmodule import get_settings @@ -40,13 +37,11 @@ def create_worktime_data() -> int: print(list(latest_records)) return 1 current_record = latest_records[0] - new_timezone = pytz.timezone('etc/GMT-7') for record in latest_records[1:]: delta = (record.time - current_record.time).seconds / 60 if delta > 5: status = 'NW' rec = FabricWorkTime.objects.get_or_create(time=current_record.time) - rec[0].time.replace(tzinfo=new_timezone) rec[0].status = status rec[0].save() else: diff --git a/repcofkk/settings.py b/repcofkk/settings.py index c43fd1f..39095b8 100644 --- a/repcofkk/settings.py +++ b/repcofkk/settings.py @@ -10,7 +10,7 @@ TEMPLATES_ROOT = os.path.join(BASE_DIR, 'templates') MEDIA_URL = '/media/' STATIC_URL = '/static/' LANGUAGE_CODE = 'ru' -TIME_ZONE = 'Asia/Krasnoyarsk' +TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = False