Git Product home page Git Product logo

Comments (4)

gumaerc avatar gumaerc commented on July 19, 2024

This has to do with the character limit on the state field being 3 characters. In certain cases states will come back with the same name in the "long_name" and "short_name" property. I discovered this and tried out expanding the character limit on the state code field and it fixed the error, but I'm not sure this is the solution we want. Maybe we want to ignore the field if the value that comes back from Google is longer than 3 characters?

from django-address.

furious-luke avatar furious-luke commented on July 19, 2024

Hi there,

Indeed, you're correct in your assessment; extending the state code length allows the value to be stored. However, I think ignoring the value makes more sense, as we already have the long name stored, and if there is no shorter code to represent it then we shouldn't need to store anything.

I've modified the code to check for duplicate codes and ignore them. However an exception will still be raised if the short code is longer than the maximum allowed length and is not a duplicate of the longer name.

I've added some new unit-tests and checked that the address mentioned goes through correctly. Please let me know if it doesn't work for you.

Cheers,
Luke

from django-address.

gumaerc avatar gumaerc commented on July 19, 2024

That makes sense. Thank you!

from django-address.

furious-luke avatar furious-luke commented on July 19, 2024

You're very welcome, thanks for the input!

from django-address.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.