diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-07-06 12:10:46 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-07-06 12:10:46 +0100 |
commit | 842ff2b00f4924f8580710c977ccce7bef33b0c2 (patch) | |
tree | e2ab4fda5a811b214fb4f501208f98f07a2c3c41 /perllib/FixMyStreet/App/Controller/Rss.pm | |
parent | deb369669b540f607e435390f4606b927569dded (diff) |
Factor out the SQL restriction from site_restriction, as it's only used in one place.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index 4d0b6cb93..f898d06a0 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -205,14 +205,14 @@ sub query_main : Private { my ( $self, $c ) = @_; my $alert_type = $c->stash->{alert_type}; - my ( $site_restriction, $site_id ) = $c->cobrand->site_restriction( $c->cobrand->extra_data ); + my ( $sql_restriction ) = $c->cobrand->sql_restriction( $c->cobrand->extra_data ); # Only apply a site restriction if the alert uses the problem table - $site_restriction = '' unless $alert_type->item_table eq 'problem'; + $sql_restriction = '' unless $alert_type->item_table eq 'problem'; # FIXME Do this in a nicer way at some point in the future... my $query = 'select * from ' . $alert_type->item_table . ' where ' . ($alert_type->head_table ? $alert_type->head_table . '_id=? and ' : '') - . $alert_type->item_where . $site_restriction . ' order by ' + . $alert_type->item_where . $sql_restriction . ' order by ' . $alert_type->item_order; my $rss_limit = mySociety::Config::get('RSS_LIMIT'); $query .= " limit $rss_limit" unless $c->stash->{type} =~ /^all/; |