File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -58,14 +58,16 @@ def get_one_goal(goal_id):
5858def 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
Original file line number Diff line number Diff line change 77slack_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"
1111client = WebClient (token = SLACK_BOT_TOKEN )
1212
1313@slack_bp .post ('/send_message' )
You can’t perform that action at this time.
0 commit comments