From a9e4df059154c914d0fd83033d092337a1f23b6b Mon Sep 17 00:00:00 2001
From: Andrew Shumway
Date: Mon, 24 Jun 2024 10:44:19 -0600
Subject: [PATCH] Todays data is only todays
---
.ds.baseline | 4 ++--
app/config.py | 1 +
app/main/views/jobs.py | 7 +++++++
app/templates/views/notifications.html | 6 +++++-
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.ds.baseline b/.ds.baseline
index 7b2ab5f89..73435047a 100644
--- a/.ds.baseline
+++ b/.ds.baseline
@@ -169,7 +169,7 @@
"filename": "app/config.py",
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
"is_verified": false,
- "line_number": 116,
+ "line_number": 117,
"is_secret": false
}
],
@@ -710,5 +710,5 @@
}
]
},
- "generated_at": "2024-06-05T22:01:56Z"
+ "generated_at": "2024-06-24T16:44:00Z"
}
diff --git a/app/config.py b/app/config.py
index e3d7c3af9..960d6331b 100644
--- a/app/config.py
+++ b/app/config.py
@@ -54,6 +54,7 @@ class Config(object):
SEND_FILE_MAX_AGE_DEFAULT = 365 * 24 * 60 * 60 # 1 year
REPLY_TO_EMAIL_ADDRESS_VALIDATION_TIMEOUT = 45
ACTIVITY_STATS_LIMIT_DAYS = {
+ "today": 0,
"one_day": 1,
"three_day": 3,
"five_day": 5,
diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py
index 6608ac419..42a4de090 100644
--- a/app/main/views/jobs.py
+++ b/app/main/views/jobs.py
@@ -150,6 +150,13 @@ def view_notifications(service_id, message_type=None):
status=request.args.get("status"),
number_of_days="one_day",
),
+ download_link_today=url_for(
+ ".download_notifications_csv",
+ service_id=current_service.id,
+ message_type=message_type,
+ status=request.args.get("status"),
+ number_of_days="today",
+ ),
download_link_three_day=url_for(
".download_notifications_csv",
service_id=current_service.id,
diff --git a/app/templates/views/notifications.html b/app/templates/views/notifications.html
index 4858382b2..487e10b98 100644
--- a/app/templates/views/notifications.html
+++ b/app/templates/views/notifications.html
@@ -76,9 +76,13 @@
Download all data last 3 days (CSV)
-
+
+
+ Download all data today (CSV)
+
{% endif %}