Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Make sure investment is only being referenced if it exists (#321)
Browse files Browse the repository at this point in the history
Co-authored-by: Nickolas Comeau <[email protected]>
  • Loading branch information
Comeani and Comeani authored Aug 29, 2023
1 parent 8d3c94d commit 31462e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bank/account_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def update_status(self) -> None:
if not proposal:
# Try to cover current raw usage with investment service units
total_usage = slurm_acct.get_cluster_usage_total(in_hours=True)
if total_usage <= investment_sus:
if investment and (total_usage <= investment_sus):
LOG.debug(f"Using investment service units to cover usage with no active proposal "
f"for {self._account_name}")
investment.current_sus -= total_usage
Expand Down

0 comments on commit 31462e1

Please sign in to comment.