Pārlūkot izejas kodu

don't insert empty tags

Daniel Sheffield 2 gadi atpakaļ
vecāks
revīzija
5d55cd7c9c
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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 = \