Commits

Anonymous committed dd9065e

MAke USPS more robust if > 5 digit zip is entered. Closes #770.

Comments (0)

Files changed (1)

satchmo/trunk/satchmo/apps/shipping/templates/shipping/usps/request_nodes.xml

 <Service>{{ config.ship_type }}</Service>
 {% ifequal config.ship_type "FIRST CLASS" %}<FirstClassMailType>{{ type }}</FirstClassMailType>{% endifequal %}
 <ZipOrigination>{{ config.shop_details.postal_code}}</ZipOrigination>
-<ZipDestination>{{ contact.shipping_address.postal_code}}</ZipDestination>
+<ZipDestination>{{ contact.shipping_address.postal_code|slice:":5"}}</ZipDestination>
 <Pounds>{{ weight|pounds }}</Pounds>
 <Ounces>{{ weight|ounces }}</Ounces>
 <Container>{{ configcontainer }}</Container>