Commit Graph

11 Commits

Author SHA1 Message Date
Leo Hemsted
f1b3ae553f add tests for get_london_midnight_in_utc with a date object
we sometimes call it with a timestamp, but sometimes with just a date
object. It works with both, lets add the tests to prove that
2019-04-02 11:52:37 +01:00
Katie Smith
ff06d120e8 Bump notifications-utils to 3.7.0
Bumped notifications-utils to 3.7.0. Version 3.7.0 includes the
`convert_utc_to_bst` and `convert_bst_to_utc` functions and the
`LETTER_PROCESSING_DEADLINE` constant, so these have been removed from
this repo and anywhere using these has now been updated to get these
from `notifications-utils`.

Also bumped pytest by a patch version to bring in a bug fix.
2018-11-26 12:53:39 +00:00
Leo Hemsted
0efa223fb2 rename days_ago to midnight_n_days_ago
also add some more timezone boundary tests and minor code cleanup
2018-04-30 11:50:56 +01:00
Leo Hemsted
9e8b6fd00d refactor template stats endpoint to read from new redis keys
New redis keys are partitioned per service per day. New process is as
follows:

* require a count of days to filter by. Currently admin always gives 7.
* for each day, check and see if there's anything in redis. There won't
  be if either a) redis is/was down or b) the service didn't send any
  notifications that day
  - if there isn't, go to the database and get a count out.
* combine all these stats together
* get the names/template types etc out of the DB at the end.
2018-04-30 11:13:21 +01:00
Leo Hemsted
5e702449cb move days_ago to utils and make it tz aware
it's used in a few places - it should definitely know what timezones
are and return datetimes rather than dates, which are hard to work with
in terms of figuring out how tz aware they are.
2018-04-30 11:13:21 +01:00
Imdad Ahad
19b09f2a27 Rename method to convert from utc to bst for consistency 2017-08-11 16:56:46 +01:00
Rebecca Law
383dee3bb2 Updated the serialization of Notification.scheduled_for to include minutes. 2017-05-24 14:52:32 +01:00
Rebecca Law
973cc2c4c9 Changed the scheduled_for datetime to only send and hour of a day to send.
Also expect the date being passed in is BST. The date is converted to UTC before saving. And converted to BST when returning a notification.
2017-05-17 15:06:15 +01:00
Ken Tsang
2b53e14a73 Add fix for bst 2017-04-03 15:49:23 +01:00
Rebecca Law
c87d0a37f3 Refactor the get_midnight functions to return the date in UTC but for the localised time.
So in June when we are in BST June 16, 00:00 BST => June 15 23:00 UTC
2017-01-27 15:57:25 +00:00
Imdad Ahad
781bef557a Add date helper methods to be used as date range filters for notification counts 2017-01-27 12:21:28 +00:00