Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

leticiabmain12
Copy link

No description provided.

Copy link

@beccaelenzil beccaelenzil left a 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

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):

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)

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

Suggested change
requests.post(url, data)
requests.post(url, data=data)

Comment on lines +87 to +103
@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()

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants