aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-06-13 13:54:20 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-06-13 16:20:20 +0100
commit9525f5765dd3621673ba688fda195de1963455df (patch)
treec0de808d46f9726c94e3cae1c79c4bd9752d573b
parentd8c4befc47afee2da94dbc2411a849f14cd1a7f7 (diff)
Use correct created column in problem timeline.
The User model now also has a created column.
-rw-r--r--CHANGELOG.md3
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm6
-rw-r--r--t/app/controller/admin/users.t4
3 files changed, 9 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7ec954119..b0b7a1dd2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,8 @@
* Unreleased
- Bugfixes:
- - Don't remove automated fields when editing contacts #2163
+ - Don't remove automated fields when editing contacts #2163
+ - Fix issue displaying admin timeline. #2159
* v2.3.4 (7th June 2018)
- Bugfixes:
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index ef078ed08..967c90af5 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -198,9 +198,9 @@ sub timeline {
return $rs->search(
{
-or => {
- created => { '>=', \"current_timestamp-'7 days'::interval" },
- confirmed => { '>=', \"current_timestamp-'7 days'::interval" },
- whensent => { '>=', \"current_timestamp-'7 days'::interval" },
+ 'me.created' => { '>=', \"current_timestamp-'7 days'::interval" },
+ 'me.confirmed' => { '>=', \"current_timestamp-'7 days'::interval" },
+ 'me.whensent' => { '>=', \"current_timestamp-'7 days'::interval" },
}
},
{
diff --git a/t/app/controller/admin/users.t b/t/app/controller/admin/users.t
index 8759e260d..0d8290c37 100644
--- a/t/app/controller/admin/users.t
+++ b/t/app/controller/admin/users.t
@@ -450,4 +450,8 @@ subtest "Removing account from admin" => sub {
is $user->email, 'removed-' . $user->id . '@example.org', 'Email gone'
};
+subtest "View timeline" => sub {
+ $mech->get_ok('/admin/timeline');
+};
+
done_testing();