diff options
-rw-r--r-- | README.md | 13 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 22 |
2 files changed, 27 insertions, 8 deletions
@@ -40,6 +40,19 @@ We've extracted all of the mobile apps from this repository into the ## Releases +* master (development) + - Performance improvements: + - Reduce memory usage. #1285 + - Bugfixes: + - Default the Google map view to hybrid. #1293 + - Prevent SVG chevron being stretched in Firefox. #1256 + - Better display/internationalisation of numbers. #1297 + - Development improvements: + - Add generic static route handler. #1235 + - Store reports summary data by cobrand. #1290 + - Admin improvements: + - Don't allow blank email/name to be submitted. + * v1.7 (23rd October 2015) - Front end improvements: - Add right-to-left design option. #1209 diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index a61032988..9a6c7bded 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -1076,16 +1076,18 @@ sub user_add : Path('user_edit') : Args(0) { $c->forward('get_token'); $c->forward('fetch_all_bodies'); - return 1 unless $c->get_param('submit'); + return unless $c->get_param('submit'); $c->forward('check_token'); - if ( $c->cobrand->moniker eq 'zurich' and $c->get_param('email') eq '' ) { + unless ($c->get_param('email')) { $c->stash->{field_errors}->{email} = _('Please enter a valid email'); - return 1; + return; + } + unless ($c->get_param('name')) { + $c->stash->{field_errors}->{name} = _('Please enter a name'); + return; } - - return unless $c->get_param('name') && $c->get_param('email'); my $user = $c->model('DB::User')->find_or_create( { name => $c->get_param('name'), @@ -1133,12 +1135,16 @@ sub user_edit : Path('user_edit') : Args(1) { $user->from_body( $c->get_param('body') || undef ); $user->flagged( $c->get_param('flagged') || 0 ); - if ( $c->cobrand->moniker eq 'zurich' and $user->email eq '' ) { + unless ($user->email) { $c->stash->{field_errors}->{email} = _('Please enter a valid email'); - return 1; + return; + } + unless ($user->name) { + $c->stash->{field_errors}->{name} = _('Please enter a name'); + return; } - $user->update; + $user->update; if ($edited) { $c->forward( 'log_edit', [ $id, 'user', 'edit' ] ); } |