Skip to content

Commit

Permalink
fix command value enum (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexviquez authored Jul 7, 2020
1 parent 0e6815f commit 41016bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions speid/commands/spei.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ def callback_spei_transaction(transaction_id, transaction_status):
"""Establece el estado de la transacción,
valores permitidos succeeded y failed"""
transaction = Transaction.objects.get(id=transaction_id)
if transaction_status == Estado.succeeded.name:
if transaction_status == Estado.succeeded.value:
transaction.estado = Estado.succeeded
event_type = EventType.completed
elif transaction_status == Estado.failed.name:
elif transaction_status == Estado.failed.value:
transaction.estado = Estado.failed
event_type = EventType.error
else:
raise ValueError('Invalid event type')
set_status_transaction(transaction.speid_id, transaction.estado.name)
set_status_transaction(transaction.speid_id, transaction.estado.value)
transaction.events.append(
Event(type=event_type, metadata=str('Reversed by SPEID command'))
)
Expand Down

0 comments on commit 41016bb

Please sign in to comment.