MozillaFoundation / donate-wagtail

[Legacy] - Wagtail based donation stack
Mozilla Public License 2.0
43 stars 22 forks source link

Zip code has no error for invalid input #367

Closed youriwims closed 3 years ago

youriwims commented 5 years ago

Issue: Zip code has no error for random, long input

zip-code error

How to fix:

====

More Info:

Comments: n/a Resources: Related to: #343 Related to: Consider making postcode optional #415 cc @philwakefield

benhohner commented 3 years ago

There are python libraries available for post codes, this may be implemented elsewhere in one of our code bases, or we may need to implement

danielfmiranda commented 3 years ago

Hi @kristinashu! I was wondering if you could provide some design feedback:

The request is now to have the post code field dissapear if the user selects a county that does not use a post code. Should I just have the City input expand all the way across the form like so?

image

Or is there a different way you think we should implement it? Thanks!

kristinashu commented 3 years ago

Making the city field go all the way across sounds good, thanks!

danielfmiranda commented 3 years ago

Hi @benhohner @Pomax @KalobTaulien I have a question regarding this task and was wondering if I can hear some thoughts on what we should do:

At the moment, the new workflow is set to become like this: 1.) User selects country 2.)We then check the list for the country, and whether or not it uses a post code. 3.) If it does use a postcode, leave the postcode field. If not, remove it and just leave city.

My question is: What should we do if the selected country is NOT in this list? One big example I can see at the moment is South Korea.

I have some ideas for things we can do: 1.) Leave the post code field displayed, but make it optional. 2.) Remove it

Here is the list of countries we are using, for reference: https://gist.github.com/lkopocinski/bd4494588458f5a8cc8ffbd12a4deefd

Thanks everyone!

danielfmiranda commented 3 years ago

Hi Everyone, I took a look at the list of countries that Braintree supports and the JSON list of countries that are going to use for post-code reference. These are the countries that we allow users to select, but are not featured on the reference list:

I am going to check whether or not these countries us post-codes through google, and will add the results to the list. Once this is complete, I should have a PR ready for review.

I also updated the time estimate for this ticket, adding the time needed to make these updates. Thanks!