Edgewall Software

Opened 9 years ago

Last modified 9 years ago

#12076 closed defect

resource_exists in trac.ticket.api should avoid database exceptions from invalid input — at Initial Version

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: 1.0.7
Component: ticket system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Reported in th:#12253, the function resource_exists in trac.ticket.api raises an exception on PostgreSQL when resource.id is not an integer.

Perhaps we should simply try converting resource.id to an integer resource_exists:

try:
   id_ = int(resource.id)
except ValueError:
   return False

Change History (0)

Note: See TracTickets for help on using tickets.