Explorar o código

bugfix translating yes/no to true/false

Daniel Sheffield %!s(int64=3) %!d(string=hai) anos
pai
achega
10f4742c46
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      grocery_transactions.py

+ 1 - 1
grocery_transactions.py

@@ -184,7 +184,7 @@ class GroceryTransactionEditor(urwid.WidgetPlaceholder):
         unit = data['unit']
         price = data['price']
         product = data['product']
-        organic = data['organic'] if data['organic'] else 'false'
+        organic = 'true' if data['organic'] == 'yes' else 'false'
         statement = \
             f"CALL insert_transaction('{ts}', $store${store}$store$, " \
             f"$descr${description}$descr$, {quantity}, $unit${unit}$unit$, " \