Skip to content

Commit

Permalink
Fix Exception, and set print in f string, not sure if second variable…
Browse files Browse the repository at this point in the history
… is right
  • Loading branch information
stevenhua0320 committed Jul 10, 2024
1 parent 61c7b5f commit eaffd5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions regolith/helpers/l_currentappointmentshelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ def sout(self):
for person in people:
p_appt = person.get("appointments", None)
if p_appt:
for k, (_id, appt) in enumerate(p_appt.items()):
for _id, appt in p_appt.items():
grantid = appt.get("grant")
if not grantid:
print("No grant found in {} appt {}".format(person.get("_id"), k))
print(f"No grant found in {person.get("_id")} appt {person.get("appt")}")
grant = fuzzy_retrieval(grants, ["name", "_id", "alias"], grantid)
if not grant:
print("No grant found for {}".format(grantid))
print(f"No grant found for {grantid}")
try:
accountnr = grant.get("account", grant["alias"])
except NotImplemented:
except Exception:
accountnr = ""
loading = appt.get("loading")
appt_dates = get_dates(appt)
Expand Down
2 changes: 1 addition & 1 deletion regolith/helpers/l_projectahelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def sout(self):
elif not isinstance(projectum.get("end_date"), dt.date):
try:
dt.datetime(*[int(num) for num in projectum.get("end_date").split("-")])
except ValueError:
except Exception:
error_projecta.append(projectum)
else:
end_date = projectum.get("end_date")
Expand Down
2 changes: 1 addition & 1 deletion regolith/helpers/makeappointmentshelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def construct_global_ctx(self):
try:
if not rc.database:
rc.database = rc.databases[0]["name"]
except NotImplemented:
except Exception:
pass
colls = [
sorted(all_docs_from_collection(rc.client, collname), key=_id_key) for collname in self.needed_colls
Expand Down

0 comments on commit eaffd5f

Please sign in to comment.