Merge pull request #112 from Pear-Trading/TBSliver/Minor-Fixes

Minor Fixes
This commit is contained in:
Finn 2018-03-21 18:05:56 +00:00 committed by GitHub
commit dc8f240243
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 3 deletions

View file

@ -2,6 +2,10 @@
# Next Release # Next Release
* **Admin Fix** Parse currency without a currency symbol on import
* **Admin Fix** Fix large CSV issue on import
* Use custom secrets for encryption
# v0.10.6 # v0.10.6
* Fixed organisation submission * Fixed organisation submission

View file

@ -34,6 +34,13 @@ sub startup {
}); });
my $config = $self->config; my $config = $self->config;
if ( defined $config->{secret} ) {
$self->secrets([ $config->{secret} ]);
} elsif ( $self->mode eq 'production' ) {
# Just incase we end up in production and it hasnt been set!
$self->secrets([ Data::UUID->new->create() ]);
}
push @{ $self->commands->namespaces }, __PACKAGE__ . '::Command'; push @{ $self->commands->namespaces }, __PACKAGE__ . '::Command';
$self->plugin('Pear::LocalLoop::Plugin::BootstrapPagination', { bootstrap4 => 1 } ); $self->plugin('Pear::LocalLoop::Plugin::BootstrapPagination', { bootstrap4 => 1 } );
@ -247,9 +254,9 @@ sub startup {
# $portal_api->post('/search')->to('api-upload#post_search'); # $portal_api->post('/search')->to('api-upload#post_search');
$self->hook( before_dispatch => sub { $self->hook( before_dispatch => sub {
my $self = shift; my $c = shift;
$self->res->headers->header('Access-Control-Allow-Origin' => '*') if $self->app->mode eq 'development'; $c->res->headers->header('Access-Control-Allow-Origin' => '*') if $c->app->mode eq 'development';
}); });
$self->helper( copy_transactions_and_delete => sub { $self->helper( copy_transactions_and_delete => sub {

View file

@ -144,7 +144,8 @@ sub _csv_flash_error {
$c->flash( $c->flash(
error => $error, error => $error,
csv_data => $c->param('csv'), # If csv info is huge, this fails epically
#csv_data => $c->param('csv'),
date_format => $c->param('date_format'), date_format => $c->param('date_format'),
); );
} }

View file

@ -9,6 +9,8 @@ sub register {
my $value; my $value;
if ( $currency_string =~ /^£([\d.]+)/ ) { if ( $currency_string =~ /^£([\d.]+)/ ) {
$value = $1 * 1; $value = $1 * 1;
} elsif ( $currency_string =~ /^([\d.]+)/ ) {
$value = $1 * 1;
} }
return $value; return $value;
}); });