|
@@ -187,7 +187,9 @@ if MOCK:
|
|
|
conn = mock_conn()
|
|
|
cur = mock_cur(records)
|
|
|
else:
|
|
|
- conn = psycopg2.connect(f"dbname=das user=pi")
|
|
|
+ import os
|
|
|
+ user = os.getenv('USER')
|
|
|
+ conn = psycopg2.connect(f"dbname=das user={user}")
|
|
|
cur = conn.cursor()
|
|
|
|
|
|
palette = [
|
|
@@ -578,7 +580,7 @@ class GroceryTransactionEditor(urwid.WidgetPlaceholder):
|
|
|
unit = self.data['unit']
|
|
|
price = self.data['price']
|
|
|
product = self.data['product']
|
|
|
- organic = self.data['organic']
|
|
|
+ organic = 'true' if self.data['organic'] else 'false'
|
|
|
log = f"{time.strftime(fmt, ts_log)}-{store}.txn"
|
|
|
with open(log, 'a') as f:
|
|
|
f.write(
|