-
Notifications
You must be signed in to change notification settings - Fork 19
Add Random Quote Route #66
Add Random Quote Route #66
Conversation
Added /random route which will provide a non-hidden quote selected at random from the database.
quotefault/__init__.py
Outdated
#quote = get_quote_query(speaker = request.args.get('speaker'), | ||
# submitter = request.args.get('submitter')).order_by(func.rand()).limit(1).all()[0][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to leave the query args on this route, otherwise please remove the comment.
quotefault/mail.py
Outdated
recipients = ["<[email protected]>","<[email protected]>"] | ||
recipients = ["<[email protected]>","<active-[email protected]>"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rebase? (or is github just not updated this yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged jabbate/master to jabbate/random-quote, so I don't know how git responds to that. I'll rebase it.
imo, don't mark this as resolving 1, since this doesn't actually implement that. Just mention the issue so anyone working on it has this context |
I believe this is good to go now |
@app.route('/random', methods=['GET']) | ||
@auth.oidc_auth | ||
def random_quote(): | ||
quote = get_quote_query(speaker = request.args.get('speaker'), \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you shouldn't need the slash, not within parentheses
Due to failed rebase of ComputerScienceHouse#66
Adds route to flask app to return a random quote in plaintext. This can be integrated into many applications, such as members page, jumpstart, etc
Resolves #2
#1 Could use this