From 3acdd72dc64adca179db10911bcd4c9657df06b1 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Thu, 10 Oct 2013 23:49:27 +0200 Subject: [PATCH] MT#4145 Change postcode to txt, fix empty reseller Postcodes can be alphanumeric in certain countries. Avoid fault when editing a contact without reseller (e.g. reseller/peer contact). You still can't save it without setting a reseller (which might not be what we want). --- lib/NGCP/Panel/Controller/Contact.pm | 2 +- lib/NGCP/Panel/Form/Contact/Reseller.pm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/NGCP/Panel/Controller/Contact.pm b/lib/NGCP/Panel/Controller/Contact.pm index c6401804be..b8b9abdc9d 100644 --- a/lib/NGCP/Panel/Controller/Contact.pm +++ b/lib/NGCP/Panel/Controller/Contact.pm @@ -126,7 +126,7 @@ sub edit :Chained('base') :PathPart('edit') :Args(0) { $params->{reseller}{id} = $c->user->reseller_id; } elsif($c->user->is_superuser) { $form = NGCP::Panel::Form::Contact::Admin->new; - $params->{reseller}{id} = $c->stash->{contact}->reseller->id; + $params->{reseller}{id} = $c->stash->{contact}->reseller_id; } else { $form = NGCP::Panel::Form::Contact::Reseller->new; } diff --git a/lib/NGCP/Panel/Form/Contact/Reseller.pm b/lib/NGCP/Panel/Form/Contact/Reseller.pm index 5b037e303c..f6723a4721 100644 --- a/lib/NGCP/Panel/Form/Contact/Reseller.pm +++ b/lib/NGCP/Panel/Form/Contact/Reseller.pm @@ -41,7 +41,8 @@ has_field 'street' => ( ); has_field 'postcode' => ( - type => 'Integer', + type => 'Text', + maxlength => 16, ); has_field 'city' => (