Git Product home page Git Product logo

Comments (3)

eld120 avatar eld120 commented on August 16, 2024

Intended behavior depends on other tickets

  • New bids should be validated by the form
  • New bids should only be accepted if they are greater than the value of previous bids (currently accepts equal to)
  • New bids should not call validation before the required user and listing objects can be attached to the bound bid form/bid object

from cs50_commerce.

eld120 avatar eld120 commented on August 16, 2024

limiting the scope of this ticket to correcting the buggy behavior around new bids:

  • refactored the Bid.highest_current_bid() function for clarity
  • corrected buggy behavior by implementing a validator on the Bid.bid property
  • Added control flow to BidForm submissions so that new bids must exceed the Bid.highest_current_bid() value

from cs50_commerce.

eld120 avatar eld120 commented on August 16, 2024

noting that Bid.bid validation (outside of modelforms) also broke as a result of this refactor. I've moved back to strictly validating against submitting negative bids within the Bid.save function.

Why? Some form of guardrails should be in place whenever money (or similar serious issues such as lives being at stake) is manipulated/transacted - even if it's fake money.

from cs50_commerce.

Related Issues (14)

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.