Parcourir la source

grants: skip companies that can't be found

a company received a grant and changed their CO with a supporter pack
raylu il y a 2 semaines
Parent
commit
5370fe8958
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      punoted/grants.py

+ 5 - 1
punoted/grants.py

@@ -16,7 +16,11 @@ def main() -> None:
 		if co is None:
 			print('\n')
 			continue
-		company = cache.get('https://rest.fnar.net/company/code/' + co)
+		try:
+			company = cache.get('https://rest.fnar.net/company/code/' + co)
+		except cache.NoContent:
+			print('no FIO REST data for', co)
+			continue
 		co_id = company['CompanyId']
 		username = company['UserName']
 		print(username, end='\t')