-
Notifications
You must be signed in to change notification settings - Fork 97
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
Leticia -Cedar #89
base: master
Are you sure you want to change the base?
Leticia -Cedar #89
Conversation
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.
Your code for Waves 01-02 is strong. You've made good use of instance methods and helper functions. I've left a few in-line comments for you to review. Please let me know if you have any questions and we'll talk more in our 1:1.
"id": self.task_id, | ||
"title": self.title, | ||
"description": self.description, | ||
"is_complete": self.completed_at is not None |
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.
This is a clever way to turn self.completed_at
into a boolean!
"is_complete": self.completed_at is not None | ||
} | ||
|
||
def post_message_on_slack(self): |
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.
Good work making this a instance method.
'channel': "task_notifications", | ||
'text': f"Someone just completed the task: {self.title}" | ||
} | ||
requests.post(url, data) |
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 looks like there's a small error here. The syntax for sending a request body is requests.pos(url, data=data)
https://docs.python-requests.org/en/latest/user/quickstart/#make-a-request
requests.post(url, data) | |
requests.post(url, data=data) |
@tasks_bp.route("/<task_id>/mark_complete", methods=["PATCH"]) | ||
def mark_complete_on_incomplete_task(task_id): | ||
|
||
task = get_task_from_id(task_id) | ||
|
||
task.completed_at = datetime.date.today() | ||
db.session.commit() | ||
|
||
task.post_message_on_slack() | ||
####i do not know what is missing here### | ||
|
||
@tasks_bp.route("/<task_id>/mark_incomplete", methods=["PATCH"]) | ||
def mark_incomplete_on_complete_task(task_id): | ||
task = get_task_from_id(task_id) | ||
|
||
task.completed_at = None | ||
db.session.commit() |
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.
These two methods still need to return a response. All route functions are required to return something. It can simply be a response code, but we should look to our tests for what exactly the response should be.
No description provided.