From 26fad4efebc0550fccb2d760df371d354c5320ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrej=20Rama=C5=A1euski?= <andrej@x2.cz> Date: Tue, 14 Mar 2023 23:40:40 +0100 Subject: [PATCH] Fixes --- lib/CF2022/Controller/Orders.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CF2022/Controller/Orders.pm b/lib/CF2022/Controller/Orders.pm index 94f78d4..dbbafe7 100644 --- a/lib/CF2022/Controller/Orders.pm +++ b/lib/CF2022/Controller/Orders.pm @@ -24,7 +24,7 @@ sub create ($c ) { my $pt = {}; CLASS: foreach my $class ( qw(main nonfree subsidy) ) { - foreach my $id ( split /\D+/, $cfg->{"products_$class"} ) { + foreach my $id ( split /\D+/, $c->config->{"products_$class"} ) { $pt->{$class}{$id} = 1; } } @@ -105,7 +105,7 @@ sub create ($c ) { $product->{id} = $accreditation; } elsif ( $pt->{nonfree}{ $product->{id} } ) { - $product->{id} = $cfg->{products_fallback}; + $product->{id} = $c->config->{products_fallback}; } } @@ -114,7 +114,7 @@ sub create ($c ) { } # fallback akreditace - @products = ( { id => $cfg->{products_fallback} }, @products ) if ! $accredited; + @products = ( { id => $c->config->{products_fallback} }, @products ) if ! $accredited; my $order = { email => $args->{email}, @@ -149,7 +149,7 @@ sub create ($c ) { company => $args->{company}, }; - $item->{answers} = \@answers if $product->{id} =~ MAIN_PRODUCTS; + $item->{answers} = \@answers if $pt->{main}{$product->{id}}; push @{ $order->{positions} }, $item; } -- GitLab