diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-10-08 11:31:21 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-10-09 08:07:14 +0100 |
commit | 2d87d6bf7c7fa4eae0e098586a0efe04c5d866fe (patch) | |
tree | eb324688d75decae69df5788fae59ce09561b2cb /perllib/FixMyStreet/App/Controller/Report/New.pm | |
parent | 76c4765536d3edbb2dc79a2a6a81a1698c9f9afa (diff) |
Fix email alert on initial update template.
A report's confirmation timestamp uses current_timestamp, and so
includes microseconds. An initial update text, to fit in with the
Open311 handling of updates, uses a DateTime object, which does not.
This means if a report is created when logged in, the initial update
can have a timestamp earlier than the report, and so is not alerted on.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 037e1992a..3b42085ff 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1736,7 +1736,10 @@ sub create_related_things : Private { my $request = { service_request_id => $problem->id, update_id => 'auto-internal', - comment_time => DateTime->now, + # Add a second so it is definitely later than problem confirmed timestamp, + # which uses current_timestamp (and thus microseconds) whilst this update + # is rounded down to the nearest second + comment_time => DateTime->now->add( seconds => 1 ), status => 'open', description => $description, }; |