Преглед на файлове

popi_reimbursement: don't bail on missing price

raylu преди 6 дни
родител
ревизия
9faf3c8994
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      popi_reimbursement.py

+ 1 - 1
popi_reimbursement.py

@@ -22,7 +22,7 @@ def main() -> None:
 				continue
 			print('\t' + contribution['Time'])
 			for mat in contribution['Materials']:
-				price = prices[mat['Ticker']]
+				price = prices.get(mat['Ticker'], 0)
 				print(f'\t\t{mat["Ticker"]} {mat["Amount"]} @ {price} = {mat["Amount"] * price}')
 
 def get_prices() -> typing.Mapping[str, float]: