| 1 | package Bracket::Form::Password::ResetEmail; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use HTML::FormHandler::Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | extends 'HTML::FormHandler::Model::DBIC'; | |||||||||
| 5 | 4 | with 'HTML::FormHandler::Render::Simple'; | |||||||||
| 6 | |||||||||||
| 7 | 4 | has '+item_class' => ( default => 'Player' ); | |||||||||
| 8 | 4 | has_field 'email' => ( type => 'Email', noupdate => 1 ); | |||||||||
| 9 | 4 | has_field 'submit' => ( type => 'Submit', value => 'Send email to reset password' ); | |||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub validate { | ||||||||
|
Subroutine
validate: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 12 | 0 | my $self = shift; | |||||||||
| 13 | |||||||||||
| 14 | # Check the given email to see that it exists in the database | ||||||||||
| 15 | 0 | my $is_valid = | |||||||||
| 16 | $self->schema->resultset('Player') | ||||||||||
| 17 | ->find( { email => $self->field('email')->value } ); | ||||||||||
| 18 | 0 | ▶ | if ( !$is_valid ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 0 | $self->field('email')->add_error('Email not on file'); | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 0 | return; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | # Turn off update_model | ||||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | sub update_model {} | ||||||||
|
Subroutine
update_model: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 28 | |||||||||||
| 29 | 4 | ▶ | no HTML::FormHandler::Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 30 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||
| 31 | 4 | 1 | |||||||||