File tree 3 files changed +10
-8
lines changed
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):
20
20
task_as_dict ["description" ] = self .description
21
21
task_as_dict ["is_complete" ] = check_for_completion (Task ,self )
22
22
if self .goal_id :
23
- task_as_dict ["goal " ] = self .goal_id
23
+ task_as_dict ["goal_id " ] = self .goal_id
24
24
25
25
return task_as_dict
26
26
Original file line number Diff line number Diff line change @@ -58,14 +58,16 @@ def get_one_goal(goal_id):
58
58
def get_tasks_for_specific_goal (goal_id ):
59
59
goal = validate_model (Goal , goal_id )
60
60
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
+
65
63
response_body = {
66
64
"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 )
69
71
70
72
return response_body , 200
71
73
Original file line number Diff line number Diff line change 7
7
slack_bp = Blueprint ('slack_bp' , __name__ )
8
8
9
9
# Slack Bot Token from environment variable
10
- SLACK_BOT_TOKEN = " os.getenv(" APITOKENHERE ")
10
+ SLACK_BOT_TOKEN = "n/a"
11
11
client = WebClient (token = SLACK_BOT_TOKEN )
12
12
13
13
@slack_bp .post ('/send_message' )
You can’t perform that action at this time.
0 commit comments