Commit Graph

192 Commits

Author SHA1 Message Date
Beverly Nguyen
d54cfdd6c0 added utc time 2024-06-18 10:06:57 -07:00
Beverly Nguyen
3594694de2 added fetch by user 2024-06-17 12:36:21 -07:00
Beverly Nguyen
0fa6e59a49 fetch notification stats by user 2024-06-12 14:32:25 -07:00
Beverly Nguyen
fed2aff43c cleaned up code 2024-06-04 16:52:32 -07:00
Beverly Nguyen
7a9d260717 fix testing 2024-06-03 15:34:43 -07:00
Beverly Nguyen
89f19bb63d cleared up style checks 2024-06-03 13:35:30 -07:00
Beverly Nguyen
758c1cd8a0 added new api for month, by year, previous 7 day stats 2024-05-29 12:13:09 -07:00
Kenneth Kehl
5b97f33831 fix flow and skip tests for now 2024-04-19 13:53:32 -07:00
stvnrlly
f600dd95d6 remove email branding 2023-12-18 16:10:12 -05:00
Andrew Shumway
83767b8ba8 remove import 2023-11-02 16:24:19 -04:00
Andrew Shumway
81f4b1436d Add notif count and history count together 2023-11-02 16:24:19 -04:00
Andrew Shumway
2fbda1cd0c Initial front end count steps 2023-11-02 16:24:19 -04:00
Kenneth Kehl
8c9721d8e2 notify-api-412 use black to enforce python coding style 2023-08-25 09:12:23 -07:00
Kenneth Kehl
00edf5d023 merge from main 2023-07-13 08:15:34 -07:00
Steven Reilly
13d0e46b52 blunt rename of org (#620) 2023-07-12 12:09:44 -04:00
Kenneth Kehl
c165589d4c notify-api-340 remove daily limit 2023-07-11 12:37:27 -07:00
Kenneth Kehl
faf0c9c629 code review feedback 2023-07-03 11:43:16 -07:00
Kenneth Kehl
4056a5d0ca fix issue with 'process_type' 2023-07-03 10:15:01 -07:00
Andrew Shumway
a1484c62bb Requested changes in PR review 2023-06-01 15:40:50 -06:00
Andrew Shumway
bd798e78b6 Added global remaining daily messages across services to ui 2023-06-01 10:44:13 -06:00
stvnrlly
944715ac46 big commit with letters removal 2022-12-05 15:33:44 -05:00
stvnrlly
f16b5dd1c4 remove broadcast-related code 2022-10-04 03:04:13 +00:00
jimmoffet
69abec0bb3 change dashboard test to reflect demo changes to uploads view 2022-09-09 17:02:48 -07:00
jimmoffet
68e6efdad0 remove redis debug config var 2022-09-08 09:07:54 -07:00
jimmoffet
dad051a662 2767 passing 2022-08-05 00:25:03 -07:00
James Moffet
1a204ae872 remove extra logs 2022-07-26 11:39:00 -07:00
James Moffet
4c25a81004 disable cache until we can fix on cloud deployment 2022-07-26 11:17:43 -07:00
James Moffet
50e660a73f devcontainer config 2022-07-19 18:23:48 -07:00
Ben Thorner
a5d18cf1a0 Simplify clearing the template cache
This is more consistent and more visible than a direct call to a
function. It makes use of the new decorator added in response to [^1].

[^1]: https://github.com/alphagov/notifications-admin/pull/4162#pullrequestreview-896208092
2022-03-07 14:42:55 +00:00
Ben Thorner
8aabaf1f49 Standardise when we clear template cache
This is consistent with all other methods: we clear the cache after
the actual change, not before it.

Since the new version of -utils, we're now catching redis exceptions
on delete, so this change has little effect on behaviour.
2022-03-07 13:54:01 +00:00
Ben Thorner
3f2b760efb Remove redundant deletion decorators
These are superseded by the "_delete_template_cache_for_service"
call in each of these methods.
2022-03-07 13:54:00 +00:00
Ben Thorner
81d9c73543 Bump -utils to 55.0.0
This renames "delete_cache_keys_by_pattern" to match the new method
name, which will also catch exceptions if Redis is down [1].

Note that this also includes a change to RecipientCSV [2], which has
no effect because the new default is the same as the old behaviour.

[1]: https://github.com/alphagov/notifications-utils/pull/949
[2]: https://github.com/alphagov/notifications-utils/pull/947/files#diff-a8a994bf655634f89dc7439880708b4ff0d780ac1bd8033827d8aaa2692a8e0fR373
2022-03-07 13:53:57 +00:00
Chris Hill-Scott
b998b6bb20 Remove methods for checking service/org name uniqueness
We don’t use these now – instead we try to update the name and see if
it works or not.
2022-01-13 10:16:07 +00:00
Katie Smith
5b52b6f9bf Clear user cache when broadcast service settings form is submitted
When the broadcast service settings form is submitted it now removes all
permissions for users in notifications-api. This means it should be
clearing the user cache.
2021-07-13 17:06:35 +01:00
Rebecca Law
77c2aa9fd6 Stop passing in today_only for the get_service_statistics method.
We now only ever call it with False.
To remove it from the api call will require a change in the API so will do that at another time.
2021-06-29 07:33:40 +01:00
Rebecca Law
44f02f2e30 To check the daily limit get the daily notification_count from redis.
The daily limit cache is set by the api when a notification is created. There is one cache key per service per day and it expires after 24 hours.
2021-06-23 15:56:05 +01:00
Andrew White
00c3943222 Disable the remaining messages check for uploads
The HTTP request for the statistics is taking more 30 seconds which leads to 504 errors from CloudFront.
2021-05-22 07:25:07 +01:00
Katie Smith
3485475270 Allow provider_restriction to be None or "all"
Until all the data is updated to always be "all", we have to handle the
case of provider_restriction being set to None or "all" (which mean the
same thing).

The code can be tidied up once the broadcast provider_restriction is never None.
2021-05-10 16:18:14 +01:00
David McDonald
f8f3d44511 Add form to set service broadcast account type
Note, no option at the moment to set the service broadcast account type
as None, or back to without the broadcast permission. This has been done
for speed of development given the chance of us needing this is very
low. We can add it later if we need to.
2021-02-23 16:03:14 +00:00
Pea Tyczynska
079f371bc5 Update attribute names following changes in API 2021-02-03 10:30:01 +00:00
Pea Tyczynska
8f21caa87a Change service billing details
View page that lets you change service billing details and
update details on form submission.
2021-02-03 10:30:01 +00:00
Pea Tyczynska
33dbfbaa65 Sort allowed attributes alphabetically 2021-02-01 17:36:04 +00:00
Pea Tyczynska
f107fe260a Allow to update service notes 2021-02-01 17:13:53 +00:00
Rebecca Law
01a3df6edc Update _delete_template_cache_for_service to delete all template version cache and not just the one ending in "None"
Update all methods that were previous calling @cache.delete('service-{service-id}-template-None') to instead call _delete_template_cache_for_service
Remove call to get service templates, it's not needed since all template version cache is being deleted.
2021-01-25 16:28:20 +00:00
Pea Tyczynska
341933478b Succesfully update service notes 2021-01-15 15:38:39 +00:00
Chris Hill-Scott
d930c885e7 Allow rate limit to be updated
This bit of code is just a safety check to make sure we don’t
inadvertently updating something we shouldn’t (see
0cfe10639a for context).

`rate_limit` is something we allow the admin app to update now (as of
939029a9be).
2020-10-23 13:00:28 +01:00
David McDonald
2921c7302c Fix incorrect redis key deleting
We were trying to delete the old 'template-{template-id}' keys but
should have been deleting the new keys which have the service id as part
of the key name. This was causing the cache to not be correctly purged
when we did things like update sender names or set defaults. This should
fix it.
2020-10-21 11:14:23 +01:00
David McDonald
beb57fed85 Delete template cache if adding a new reply to email address
As if this is chosen as default, then the template data will be stale as
they do not have the latest reply to address.

We are already doing this for create/update/delete for sms senders and
contact lists for letters, it was just the create we were missing for
email reply to addresses.
2020-10-07 17:32:10 +01:00
David McDonald
7b82ca5083 Remove deleting of old redis key
At this point we are no longer setting this key, nor are we reading from
it so we are able to delete it.
2020-10-02 15:21:30 +01:00
David McDonald
a538329d0e Use new redis key for service templates and broadcasts
We can drop use of the old key as we no longer need to read data from
the old key. Either data exists in the new key and we read it from there
or data doesn't exist in the new key and we go to the API to get it and
then set it in redis.

Note, the previous commit is important because it means we aren't at
risk of when this commit is being deployed out, of us getting stale data
from the old key.
2020-09-21 17:37:27 +01:00