-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whales - Alexa Coffman #107
base: master
Are you sure you want to change the base?
Conversation
…to wave 01 and 03 to account for new goal_id attribute
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.
Well done!
Your code is clear, clean and easy to read.
Great job!
"channel" : "task-notifications", | ||
"text" : f"Someone just completed the task {task.title}" | ||
} | ||
headers = {"authorization" : "Bearer " + bot_token} |
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.
The reason your tests fail on Learn is because you try to use the token without first verifying that it is not None
.
A check at the beginning of this that does an early return if there's no token is probably the correct way to solve this (since if Slack/not configured is down you'd like your API to still work).
try: | ||
goal_id = int(goal_id) | ||
except ValueError: | ||
return jsonify({"msg" : f"'{goal_id}' is invalid"}), 400 |
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.
Nice job including the invalid goal_id
! 😃
No description provided.