Skip to content

Commit 495b25c

Browse files
knikollaQuanMPhm
andcommitted
Update src/coldfront_plugin_cloud/management/commands/fetch_daily_billable_usage.py
Co-authored-by: Quan Pham <[email protected]>
1 parent c4766ba commit 495b25c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/coldfront_plugin_cloud/management/commands/fetch_daily_billable_usage.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,10 @@ def handle_alerting(
277277
@staticmethod
278278
def get_managers(allocation: Allocation):
279279
"""Returns list of managers with enabled notifications."""
280-
managers = []
281-
282280
managers_query = allocation.project.projectuser_set.filter(
283-
role__name="Manager", status__name="Active"
281+
role__name="Manager", status__name="Active", enable_notifications=True
284282
)
285-
for manager in managers_query:
286-
if manager.enable_notifications:
287-
managers.append(manager.user.email)
288-
289-
return managers
283+
return [manager.user.email for manager in managers_query]
290284

291285
@classmethod
292286
def send_alert_email(cls, allocation: Allocation, resource: Resource, alert_value):

0 commit comments

Comments
 (0)