From 8689a68c2f2644da8e5a30651608cdc760216a37 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 8 Apr 2021 23:58:44 -0600 Subject: [PATCH] Skip asking for a ticket ID twice For this to happen the tech has to disable osTicket integration first so in that case just set ticket to the date. No need asking again. Addresses issue #132 (I think, couldn't reproduce) --- scripts/wk/hw/ddrescue.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/wk/hw/ddrescue.py b/scripts/wk/hw/ddrescue.py index 9b6d2957..c796fc61 100644 --- a/scripts/wk/hw/ddrescue.py +++ b/scripts/wk/hw/ddrescue.py @@ -1696,14 +1696,10 @@ def get_working_dir( working_dir = None # Set ticket ID - while ticket_id is None: - ticket_id = std.input_text( - prompt='Please enter ticket ID:', - allow_empty_response=False, - ) - ticket_id = ticket_id.replace(' ', '_') - if not re.match(r'^\d+', ticket_id): - ticket_id = None + if ticket_id is None: + now = datetime.datetime.now(tz=TIMEZONE) + ticket_id = now.strftime('%Y-%m-%dT%H%M_%Z') + ticket_id = ticket_id.replace(' ', '_') # Use preferred path if possible if mode == 'Image':