Skip to content

Commit eba7f6b

Browse files
Fixing SonarQube issue
1 parent 3672442 commit eba7f6b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pages/screening_practitioner_appointments/book_appointment_page.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from utils.table_util import TableUtils
44
from datetime import datetime
55
from utils.calendar_picker import CalendarPicker
6+
from typing import Optional
67

78

89
class BookAppointmentPage(BasePage):
@@ -49,7 +50,7 @@ def click_save_button(self) -> None:
4950
"""Clicks the save button."""
5051
self.safe_accept_dialog(self.save_button)
5152

52-
def click_save_button_and_return_message(self) -> str | None:
53+
def click_save_button_and_return_message(self) -> Optional[str]:
5354
"""
5455
Clicks the save button and returns the dialog message if a dialog appears.
5556
Returns None if no dialog appears.

utils/appointments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def book_post_investigation_appointment(
168168
current_time = f"{hour:02d}:{minute:02d}"
169169
book_appointments_page.enter_appointment_start_time(current_time)
170170
dialog_message = book_appointments_page.click_save_button_and_return_message()
171-
if dialog_message is None or overlap_message not in dialog_message:
171+
if dialog_message is None or overlap_message not in (dialog_message or ""):
172172
# Success or no overlap dialog
173173
break
174174
# Increase time by 15 minutes

0 commit comments

Comments
 (0)