diff --git a/lib/Pear/LocalLoop/Controller/Register.pm b/lib/Pear/LocalLoop/Controller/Register.pm index 2967afd..49e2d94 100644 --- a/lib/Pear/LocalLoop/Controller/Register.pm +++ b/lib/Pear/LocalLoop/Controller/Register.pm @@ -11,7 +11,7 @@ has error_messages => sub { postcode => 'Postcode is required, and must be a valid UK Postcode', token => 'Token is required, and must be a valid, unused token', agerange => 'Age Range is required, and must be a selection from the drop-down', - unknown => 'Sorry, there was a problem registering!', + unknown => 'Sorry, there was a problem registering! Have you already registered?', }; }; @@ -44,8 +44,6 @@ sub register { if ( $validation->has_error ) { my $failed_vals = $validation->failed; @error_messages = map {$c->error_messages->{ $_ } } @$failed_vals; - - $c->render( template => 'register/index' ); } else { my $new_user = $c->schema->resultset('User')->find_or_new({ email => $validation->param('email'), @@ -77,6 +75,7 @@ sub register { agerange => $validation->param('agerange'), } ); + $c->render( template => 'register/index' ); } else { $c->flash( success => 'Registered Successfully, please log in' ); $c->redirect_to('/'); diff --git a/lib/Pear/LocalLoop/Schema/Result/User.pm b/lib/Pear/LocalLoop/Schema/Result/User.pm index b8b35e7..4aa85fa 100644 --- a/lib/Pear/LocalLoop/Schema/Result/User.pm +++ b/lib/Pear/LocalLoop/Schema/Result/User.pm @@ -161,7 +161,7 @@ Related object: L =cut __PACKAGE__->belongs_to( - "customerid_fk", + "customer", "Pear::LocalLoop::Schema::Result::Customer", { customerid => "customerid_fk" }, {