diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2014-08-04 16:12:50 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2014-08-14 09:44:30 +0000 |
commit | 963bfbc11643e0499162e33161ab539c6dcb611f (patch) | |
tree | dadb9f97c0d369dfd821d32ddfde7c25fc141219 /perllib | |
parent | 382a782c16a998776176de37037dd029fab4e3fe (diff) |
Tests for moderation
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Moderate.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Moderate.pm b/perllib/FixMyStreet/App/Controller/Moderate.pm index bf70d52c5..b2bd3db3d 100644 --- a/perllib/FixMyStreet/App/Controller/Moderate.pm +++ b/perllib/FixMyStreet/App/Controller/Moderate.pm @@ -124,9 +124,9 @@ sub report_moderate_hide : Private { if ($c->req->param('problem_hide')) { - $problem->update({ state => 'hidden' }); + $c->res->redirect( '/' ); # Go directly to front-page $c->detach( 'report_moderate_audit', ['hide'] ); # break chain here. } } diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 526fbff90..3fae6860a 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -207,6 +207,8 @@ __PACKAGE__->has_many( # Schema::Loader, but that doesn't know about the problem_id mapping, so we now # (slightly hackishly) redefine here: # +# we also add cascade_delete, though this seems to be insufficient. +# # TODO: should add FK on moderation_original_data field for this, to get S::L to # pick up without hacks. @@ -216,7 +218,7 @@ __PACKAGE__->might_have( { "foreign.comment_id" => "self.id", "foreign.problem_id" => "self.problem_id", }, - { cascade_copy => 0, cascade_delete => 0 }, + { cascade_copy => 0, cascade_delete => 1 }, ); # we need the inline_constructor bit as we don't inherit from Moose |