Fix web portal upload basic form

This commit is contained in:
Tom Bloor 2017-04-21 17:33:50 +01:00
parent 786b69f54d
commit 8c424c02d3

View file

@ -97,33 +97,18 @@ sub post_upload {
my $town = $validation->param('town'); my $town = $validation->param('town');
my $postcode = $validation->param('postcode'); my $postcode = $validation->param('postcode');
my $fullAddress = "";
if ( defined $street_name && ! ($street_name =~ m/^\s*$/) ){
$fullAddress = $street_name;
}
if ( defined $town && ! ($town =~ m/^\s*$/) ){
if ($fullAddress eq ""){
$fullAddress = $town;
}
else{
$fullAddress = $fullAddress . ", " . $town;
}
}
my $pending_org = $c->schema->resultset('PendingOrganisation')->create({ my $pending_org = $c->schema->resultset('PendingOrganisation')->create({
usersubmitted_fk => $user->id, submitted_by => $user,
timedatesubmitted => DateTime->now, submitted_at => DateTime->now,
name => $organisation_name, name => $organisation_name,
fulladdress => $fullAddress, street_name => $street_name,
town => $town,
postcode => $postcode, postcode => $postcode,
}); });
$c->schema->resultset('PendingTransaction')->create({ $c->schema->resultset('PendingTransaction')->create({
buyeruserid_fk => $user->id, buyeruserid_fk => $user->id,
pendingsellerorganisationid_fk => $pending_org->pendingorganisationid, pendingsellerorganisationid_fk => $pending_org->id,
valuemicrocurrency => $transaction_value, valuemicrocurrency => $transaction_value,
proofimage => $filename, proofimage => $filename,
timedatesubmitted => DateTime->now, timedatesubmitted => DateTime->now,