GithubHelp home page GithubHelp logo

cmpe327's People

Contributors

16cmc21 avatar joshua-neizer avatar nicoleooi avatar ted537 avatar

Watchers

 avatar  avatar

cmpe327's Issues

update_post() error pages will never be seen

cmpe327/qa327/frontend.py

Lines 184 to 206 in d68f5ca

def error_page(msg):
"""
Render error message on index page.
:param msg: text of the error message
:return: default page with error message
"""
flash(msg)
return redirect('/', code=303)
prev_ticket_name = request.form.get('update-prev-ticket-name')
upt_ticket_name = request.form.get('update-upt-ticket-name')
ticket_quantity = request.form.get('update-ticket-quantity')
ticket_price = request.form.get('update-ticket-price')
ticket_expiration_date = request.form.get('update-ticket-expiration-date')
is_blank = {
'name': len(upt_ticket_name) == 0,
'quantity' : len(ticket_quantity) == 0,
'price' : len(ticket_price) == 0,
'exp-date' : len(ticket_expiration_date) == 0
}
if not bn.get_ticket(user.id, prev_ticket_name):
error_page("Ticket doesn't exist")

error_page() returns a value; it has no side effect. Calling the function does nothing. Should use return error_page('your message here') instead.

Note: this is an implementation detail fix, it is not necessary for A4 as correctness will be fixed up in A5.

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.