aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-12-15 16:54:06 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-12-15 16:54:06 +0000
commit60f9a76764341c130241d6a6e3dd445626cbefdf (patch)
treea794dead5ebb0fa8a7338e8fd1e088feb372c12b
parentb064b041675c907a5646487985825f078208f4d4 (diff)
parent4a4a80ae1f93dbca893830088f03e054bbfa77ea (diff)
Merge remote-tracking branch 'origin/admin-blank-email-name' into admin-blank-email-name
-rw-r--r--README.md12
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm22
2 files changed, 26 insertions, 8 deletions
diff --git a/README.md b/README.md
index 001ffee01..d1450858f 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,18 @@ 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
+ - 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' ] );
}