Skip to content

Commit 4085d14

Browse files
committed
delete APP_TIME_ZONE
1 parent 4b802dc commit 4085d14

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

appointment/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
APPOINTMENT_LEAD_TIME = getattr(settings, 'APPOINTMENT_LEAD_TIME', (9, 0))
2222
APPOINTMENT_FINISH_TIME = getattr(settings, 'APPOINTMENT_FINISH_TIME', (18, 30))
2323
APP_DEFAULT_FROM_EMAIL = getattr(settings, 'DEFAULT_FROM_EMAIL', DEFAULT_FROM_EMAIL)
24-
APP_TIME_ZONE = getattr(settings, 'TIME_ZONE', 'America/New_York')
2524

2625

2726
def check_q_cluster():

appointment/tests/utils/test_date_time.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from django.test import TestCase
88

9-
from appointment.settings import APP_TIME_ZONE
109
from appointment.utils.date_time import (
1110
combine_date_and_time, convert_12_hour_time_to_24_hour_time, convert_24_hour_time_to_12_hour_time,
1211
convert_minutes_in_human_readable_format, convert_str_to_date,

appointment/utils/date_time.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from django.utils import timezone
1212
from django.utils.translation import gettext_lazy as _, ngettext
1313

14-
from appointment.settings import APP_TIME_ZONE
15-
1614

1715
def combine_date_and_time(date, time) -> datetime.datetime:
1816
"""Combine a date and a time into a datetime object.

appointment/utils/view_helpers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88

99
import uuid
1010

11+
from django.conf import settings
1112
from django.utils.translation import get_language, to_locale
1213

13-
from appointment.settings import APP_TIME_ZONE
14-
1514

1615
def get_locale() -> str:
1716
"""Get the current locale based on the user's language settings, without the country code.
@@ -49,7 +48,7 @@ def get_timezone_txt() -> str:
4948
5049
:return: The current timezone in a string format.
5150
"""
52-
tmz = APP_TIME_ZONE
51+
tmz = settings.TIME_ZONE
5352
timezone_map = {
5453
'UTC': 'Universal Time Coordinated (UTC)',
5554
'US/Eastern': 'Eastern Daylight Time (US & Canada)',

appointment/views.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from datetime import date, datetime, timedelta
1010

1111
import pytz
12+
from django.conf import settings
1213
from django.contrib import messages
1314
from django.contrib.auth import login
1415
from django.contrib.auth.forms import SetPasswordForm
@@ -41,7 +42,7 @@
4142
from .decorators import require_ajax
4243
from .messages_ import passwd_error, passwd_set_successfully
4344
from .services import get_appointments_and_slots, get_available_slots_for_staff
44-
from .settings import (APPOINTMENT_PAYMENT_URL, APPOINTMENT_THANK_YOU_URL, APP_TIME_ZONE)
45+
from .settings import (APPOINTMENT_PAYMENT_URL, APPOINTMENT_THANK_YOU_URL)
4546
from .utils.date_time import convert_str_to_date, convert_str_to_time
4647
from .utils.error_codes import ErrorCode
4748
from .utils.json_context import get_generic_context_with_extra, json_response
@@ -96,7 +97,7 @@ def get_available_slots_ajax(request):
9697
# Check if the selected_date is today and filter out past slots
9798
if selected_date == date.today():
9899
# Get the current time in EDT timezone
99-
current_time_edt = datetime.now(pytz.timezone(APP_TIME_ZONE)).time()
100+
current_time_edt = datetime.now(pytz.timezone(settings.TIME_ZONE)).time()
100101
available_slots = [slot for slot in available_slots if convert_str_to_time(slot) > current_time_edt]
101102

102103
custom_data['available_slots'] = available_slots

0 commit comments

Comments
 (0)