Show error if ticket not found

* Fixes issue #80
This commit is contained in:
2Shirt 2019-04-25 19:45:18 -07:00
parent f6fdc047cf
commit 2a0a80b09a
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -454,13 +454,17 @@ class osTicket():
if not re.match(r'^(\d+)$', _input): if not re.match(r'^(\d+)$', _input):
continue continue
# Valid ID entered, lookup name and verify # Valid ID entered, lookup name
try: try:
_name = self.get_ticket_name(_input) _name = self.get_ticket_name(_input)
except Exception: except Exception:
# Ignore and return None below # Ignore and return None below
break break
if _name:
# Verify
if _name is None:
print_error('ERROR: Ticket {} not found.'.format(_input))
elif _name:
print_standard('You have selected ticket #{} {}'.format( print_standard('You have selected ticket #{} {}'.format(
_input, _name)) _input, _name))
if ask('Is this correct?'): if ask('Is this correct?'):