|
6 | 6 | Since: 1.0.0
|
7 | 7 | """
|
8 | 8 |
|
9 |
| -from datetime import date, datetime, timedelta |
| 9 | +from datetime import date, timedelta |
10 | 10 |
|
11 |
| -import pytz |
12 |
| -from django.conf import settings |
13 | 11 | from django.contrib import messages
|
14 | 12 | from django.contrib.auth import login
|
15 | 13 | from django.contrib.auth.forms import SetPasswordForm
|
16 | 14 | from django.db.models import Q
|
17 | 15 | from django.http import HttpResponseRedirect
|
18 | 16 | from django.shortcuts import get_object_or_404, redirect, render
|
19 | 17 | from django.urls import reverse
|
| 18 | +from django.utils import timezone |
20 | 19 | from django.utils.encoding import force_str
|
21 | 20 | from django.utils.http import urlsafe_base64_decode
|
22 | 21 | from django.utils.timezone import get_current_timezone_name
|
|
44 | 43 | from .messages_ import passwd_error, passwd_set_successfully
|
45 | 44 | from .services import get_appointments_and_slots, get_available_slots_for_staff
|
46 | 45 | from .settings import (APPOINTMENT_PAYMENT_URL, APPOINTMENT_THANK_YOU_URL)
|
47 |
| -from .utils.date_time import convert_str_to_date, convert_str_to_time |
| 46 | +from .utils.date_time import convert_str_to_date |
48 | 47 | from .utils.error_codes import ErrorCode
|
49 | 48 | from .utils.json_context import get_generic_context_with_extra, json_response
|
50 | 49 |
|
@@ -97,7 +96,7 @@ def get_available_slots_ajax(request):
|
97 | 96 |
|
98 | 97 | # Check if the selected_date is today and filter out past slots
|
99 | 98 | if selected_date == date.today():
|
100 |
| - current_time = datetime.now(pytz.timezone(settings.TIME_ZONE)).time() |
| 99 | + current_time = timezone.now().time() |
101 | 100 | available_slots = [slot for slot in available_slots if slot.time() > current_time]
|
102 | 101 |
|
103 | 102 | custom_data['available_slots'] = [slot.strftime('%I:%M %p') for slot in available_slots]
|
|
0 commit comments