Ver Fonte

don't insert empty tags

Daniel Sheffield há 2 anos atrás
pai
commit
5d55cd7c9c
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      grocery_transactions.py

+ 1 - 1
grocery_transactions.py

@@ -93,7 +93,7 @@ class GroceryTransactionEditor(WidgetPlaceholder):
         product = data['product']
         organic = 'true' if data['organic'] is True else 'false'
         tags = ', '.join([
-            f'$quot${v}$quot$' for t,v in data.items() if 'tags' in t
+            f'$quot${v}$quot$' for t,v in data.items() if 'tags' in t and v
         ])
         tags = f", ARRAY[{tags}]" if tags else ''
         statement = \