Skip to content

Commit f80a1f2

Browse files
committed
wave six, all tests have succesfully passed, everything works so far! entering wave 7 now, will refactor later if time permits
1 parent 0aca135 commit f80a1f2

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

app/models/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def to_dict(self):
2020
task_as_dict["description"] = self.description
2121
task_as_dict["is_complete"] = check_for_completion(Task,self)
2222
if self.goal_id:
23-
task_as_dict["goal"] = self.goal_id
23+
task_as_dict["goal_id"] = self.goal_id
2424

2525
return task_as_dict
2626

app/routes/goal_routes.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ def get_one_goal(goal_id):
5858
def get_tasks_for_specific_goal(goal_id):
5959
goal = validate_model(Goal, goal_id)
6060
goal_as_dict = goal.to_dict()
61-
print(goal_as_dict)
62-
request_arguement = {"Goal_Id": goal_id}
63-
filtered_result_body= get_models_with_filters(Task, request_arguement)
64-
61+
tasks = [task.to_dict() for task in goal.tasks]
62+
6563
response_body = {
6664
"id": goal_as_dict.get("id"),
67-
"title": goal_as_dict.get("title"),
68-
"tasks": (filtered_result_body)}
65+
"title": goal_as_dict.get('title'),
66+
"tasks": tasks
67+
}
68+
for key, value in goal_as_dict.items():
69+
print("Key is : ", key),
70+
print("Value is :", value)
6971

7072
return response_body, 200
7173

app/routes/slack_routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
slack_bp = Blueprint('slack_bp', __name__)
88

99
# Slack Bot Token from environment variable
10-
SLACK_BOT_TOKEN =" os.getenv("APITOKENHERE")
10+
SLACK_BOT_TOKEN ="n/a"
1111
client = WebClient(token=SLACK_BOT_TOKEN)
1212

1313
@slack_bp.post('/send_message')

0 commit comments

Comments
 (0)