fixed error message and validation
[sgn.git] / lib / SGN / Controller / NOAANCDC.pm
blobc5e593927ee98db9d3d420b2bc071f9989acec94
2 package SGN::Controller::NOAANCDC;
4 use Moose;
5 use URI::FromHash 'uri';
6 use Data::Dumper;
8 BEGIN { extends 'Catalyst::Controller' };
10 sub noaa_ncdc_analysis :Path('/noaa_ncdc_analysis') Args(0) {
11 my $self = shift;
12 my $c = shift;
14 my $schema = $c->dbic_schema("Bio::Chado::Schema");
15 my $user_id;
16 if ($c->user()) {
17 $user_id = $c->user->get_object()->get_sp_person_id();
19 if (!$user_id) {
20 $c->res->redirect( uri( path => '/user/login', query => { goto_url => $c->req->uri->path_query } ) );
23 $c->stash->{template} = '/breeders_toolbox/noaa_ncdc_analysis.mas';