Переглянути джерело

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]: