Git Product home page Git Product logo

Comments (1)

chrismaddalena avatar chrismaddalena commented on May 18, 2024

@lez0sec Thank you for reporting this! Sorry it has taken me so long to acknowledge this. The world had other plans for my priorities over these past couple of months, but a big update will be coming soon 🙂

Your observation is correct; the logic does not work as intended. The intention was for any entry for auto_renew to be interpreted as True. That's flawed on its own because a No/Disabled/False/etc entry would be treated as "True," but I had meant to revisit that later. The logic was incorrect because it checked if auto_renew was in the row, which it always would be if you had the column in your csv file. It was not checking if it was blank or not after that.

I also did some additional testing with various inputs that showed untrimmed spaces caused errors as well. The csv entries are now stripped before any value checks.

I am using your suggested solution. I slightly expanded it to include a pair of other potential options. This will be in the next update I am bringing in as a PR shortly:

            # Accept a variety of "True" values to mean True
            # Thanks to @lez0sec for fixing this logic:
            #   https://github.com/GhostManager/Ghostwriter/issues/73
            if 'auto_renew' in entry:
                if any(yes_option in entry['auto_renew'].lower().strip().strip() for yes_option in ['yes', 'enabled', 'true', 'x', 'enable']):
                    entry['auto_renew'] = True
                else:
                    entry['auto_renew'] = False

from ghostwriter.

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.