diff options
-rw-r--r-- | distixlib/ticket_store.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/distixlib/ticket_store.py b/distixlib/ticket_store.py index 3c6a09d..1a8b809 100644 --- a/distixlib/ticket_store.py +++ b/distixlib/ticket_store.py @@ -137,10 +137,9 @@ class TicketStore(object): if ticket_id is None: raise TicketHasNoId() - for existing in self.get_tickets(): - if ticket_id == existing.get_ticket_id(): - raise distixlib.TicketAlreadyInStoreError( - ticket_id=ticket_id, dirname=self._dirname) + if ticket_id in self.get_ticket_ids(): + raise distixlib.TicketAlreadyInStoreError( + ticket_id=ticket_id, dirname=self._dirname) self._dirty = True self._ticket_cache.put(ticket) |