From da34d1586ddb34fd4ae5b35c0097ce936e02ac5a Mon Sep 17 00:00:00 2001 From: geistling <34081638+geistling@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:27:28 -0400 Subject: [PATCH] clarify comparison units --- coldfront/core/utils/fasrc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coldfront/core/utils/fasrc.py b/coldfront/core/utils/fasrc.py index e336cf8e9..7f1eec9c2 100644 --- a/coldfront/core/utils/fasrc.py +++ b/coldfront/core/utils/fasrc.py @@ -133,15 +133,15 @@ def get_resource_rate(resource): return round(price/100, 2) -def allocation_reaching_capacity_operations(allocation_obj, new_usage): - """if allocation_obj.usage is <80/90% of allocation_obj.limit and new_usage +def allocation_reaching_capacity_operations(allocation_obj, new_byte_usage): + """if allocation_obj.usage is <80/90% of allocation_obj.limit and new_byte_usage >80/90% of allocation_obj.limit, send email to pi and data manager. """ threshold = None for limit in [90, 80]: if ( allocation_obj.usage_exact/allocation_obj.size_exact < limit/100 - and new_usage/allocation_obj.size > limit/100 + and new_byte_usage/allocation_obj.size_exact > limit/100 ): threshold = limit if threshold: