Open
Conversation
CheezItMan
reviewed
Nov 8, 2021
CheezItMan
left a comment
There was a problem hiding this comment.
Nice work Tirhas, you hit the learning goals here. Well done. I left some minor feedback, but overall this is a very solid submission. You did well on the helper methods and wrote effective tests. Let me know if you have any questions.
Comment on lines
+12
to
+27
| def list_of_task_id(self): | ||
| task_ids =[task.id for task in self.tasks] | ||
| return task_ids | ||
|
|
||
| def to_dict(self): | ||
| if self.list_of_task_id(): | ||
|
|
||
| return {"id":self.id, | ||
| "title":self.title, | ||
| "task_ids":self.list_of_task_id() | ||
| } | ||
| else: | ||
| return {"id":self.id, | ||
| "title":self.title, | ||
| } | ||
| def task_lists(self): |
Comment on lines
+17
to
+30
| if self.goal_id is None: | ||
|
|
||
| return {"id":self.id, | ||
| "title":self.title, | ||
| "description":self.description, | ||
| "is_complete":self.check_for_completed_task() | ||
| } | ||
| else: | ||
| return {"id":self.id, | ||
| "title":self.title, | ||
| "description":self.description, | ||
| "is_complete":self.check_for_completed_task(), | ||
| "goal_id": self.goal_id | ||
| } |
There was a problem hiding this comment.
This can be dried up a bit.
Suggested change
| if self.goal_id is None: | |
| return {"id":self.id, | |
| "title":self.title, | |
| "description":self.description, | |
| "is_complete":self.check_for_completed_task() | |
| } | |
| else: | |
| return {"id":self.id, | |
| "title":self.title, | |
| "description":self.description, | |
| "is_complete":self.check_for_completed_task(), | |
| "goal_id": self.goal_id | |
| } | |
| task_dict = { | |
| "id":self.id, | |
| "title":self.title, | |
| "description":self.description, | |
| "is_complete":self.check_for_completed_task() | |
| } | |
| if self.goal_id is not None: | |
| task_dict["goal_id"] = self.goal_id | |
| return task_dict |
Comment on lines
+19
to
+29
| def slack_notification(): | ||
| load_dotenv() | ||
| slack_token = os.environ["SLACK_TOKENS"] | ||
| client = WebClient(token=slack_token) | ||
| try: | ||
| response = client.chat_postMessage( | ||
| channel ="CNEEJDLAW", | ||
| text = "Task completed" | ||
| ) | ||
| except SlackApiError as e: | ||
| return jsonify({"Error": "chanel not found"}) |
Comment on lines
+86
to
+89
| assert response_body =={ | ||
| "goal":{"id": 1, | ||
| "title": "complete my project successfully"} | ||
| } |
There was a problem hiding this comment.
Just readability
Suggested change
| assert response_body =={ | |
| "goal":{"id": 1, | |
| "title": "complete my project successfully"} | |
| } | |
| assert response_body == { | |
| "goal": { | |
| "id": 1, | |
| "title": "complete my project successfully" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.