@@ -30,7 +30,7 @@ def get_child():
3030 "childName" : child .first_name ,
3131 "dateOfBirth" : child .date_of_birth ,
3232 "cpinFileNumber" : child .cpin_number ,
33- "serviceWorker " : child .service_worker ,
33+ "workerName " : child .service_worker ,
3434 "specialNeeds" : child .special_needs ,
3535 "concerns" : [],
3636 "childId" : child .id
@@ -95,6 +95,7 @@ def run_undos():
9595
9696 try :
9797 daytime_response = daytimeContact_service .create_new_daytime_contact (CreateDaytimeContactDTO (** daytimeContact_obj ))
98+ print (daytime_response , file = sys .stderr )
9899 undos .append ((daytime_response ,"delete_daytime_contact" , daytime_response .id ))
99100 except Exception as error :
100101 run_undos ()
@@ -113,6 +114,7 @@ def run_undos():
113114
114115 try :
115116 child_response = child_service .add_new_child (CreateChildDTO (** child_obj ))
117+ print (child_response , file = sys .stderr )
116118 undos .append ((child_service , "delete_child" , child_response .id ))
117119 except Exception as error :
118120 run_undos ()
@@ -137,35 +139,34 @@ def run_undos():
137139 providers = request .json ["providers" ]
138140
139141 child_obj = {
140- "intake_id" : intake_id ,
141142 "first_name" : child_details ["child_name" ],
142143 "last_name" : "." ,
143144 "date_of_birth" : child_details ["date_of_birth" ],
144145 "cpin_number" : child_details ["cpin_file_number" ],
145- "service_worker" : child_details ["service_worker" ],
146- "daytime_contact_id" : daytimeContact_details ["school_id" ],
146+ "service_worker" : child_details ["worker_name" ],
147147 "special_needs" : child_details ["special_needs" ],
148148 }
149149
150150 try :
151151 child_response = child_service .edit_child (child_obj , child_details ["child_id" ])
152+ #print(child_response, file=sys.stderr)
152153 # undos.append((child_service, "delete_child", child_response.id))
153154 except Exception as error :
154155 # run_undos()
155156 return jsonify (error ),400
156157
157- daytimeContact_obj = {
158- "name" : daytimeContact_details ["school_name" ],
159- "contact_information" : daytimeContact_details ["school_phone_no" ],
160- "address" : daytimeContact_details ["school_address" ],
161- "dismissal_time" : daytimeContact_details ["dismissal_time" ],
162- }
163-
164- try :
165- daytime_response = daytimeContact_service .edit_daytime_contact (daytimeContact_obj , daytimeContact_details ["school_id" ])
166- except Exception as error :
167- # run_undos()
168- return jsonify (error ),400
158+ # daytimeContact_obj ={
159+ # "name": daytimeContact_details["school_name"],
160+ # "contact_information": daytimeContact_details["school_phone_no"],
161+ # "address": daytimeContact_details["school_address"],
162+ # "dismissal_time": daytimeContact_details["dismissal_time"],
163+ # }
164+
165+ # try:
166+ # daytime_response = daytimeContact_service.edit_daytime_contact(daytimeContact_obj, daytimeContact_details["school_id"])
167+ # except Exception as error:
168+ # # run_undos()
169+ # return jsonify(error),400
169170
170171
171172 return jsonify (child_response .__dict__ ), 200
0 commit comments