aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Admin.pm
diff options
context:
space:
mode:
authorChris Mytton <self@hecticjeff.net>2013-10-16 14:09:32 +0100
committerChris Mytton <self@hecticjeff.net>2013-10-16 14:09:32 +0100
commit762c106ec81a4923d35b1eb4c60d762e60a495bf (patch)
tree4b7244a7e1fbfd53a7ef950a02072c162999af71 /perllib/FixMyStreet/App/Controller/Admin.pm
parent0efb806e7dbfc6681230041751ed49552ec3ba5b (diff)
parent6daf4d511f5a2fd908d53ee974e04be4bf3ee722 (diff)
Merge branch 'master' into oxfordshire-usability-recommendations
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 424f68ba3..6264d1a73 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -961,6 +961,11 @@ sub user_add : Path('user_edit') : Args(0) {
$c->forward('check_token');
+ if ( $c->cobrand->moniker eq 'zurich' and $c->req->param('email') eq '' ) {
+ $c->stash->{field_errors}->{email} = _('The email field is required');
+ return 1;
+ }
+
return unless $c->req->param('name') && $c->req->param('email');
my $user = $c->model('DB::User')->find_or_create( {
@@ -1008,6 +1013,11 @@ sub user_edit : Path('user_edit') : Args(1) {
$user->email( $c->req->param('email') );
$user->from_body( $c->req->param('body') || undef );
$user->flagged( $c->req->param('flagged') || 0 );
+
+ if ( $c->cobrand->moniker eq 'zurich' and $user->email eq '' ) {
+ $c->stash->{field_errors}->{email} = _('The email field is required');
+ return 1;
+ }
$user->update;
if ($edited) {