def run(self, args, **kwargs): instance = Inquiry() instance.id = args.id inquiry = self.get_resource_by_id(id=args.id, **kwargs) if args.response: instance.response = json.loads(args.response) else: response = InteractiveForm( inquiry.schema.get('properties')).initiate_dialog() instance.response = response return self.manager.respond(inquiry_id=instance.id, inquiry_response=instance.response, **kwargs)
def run(self, args, **kwargs): instance = Inquiry() instance.id = args.id inquiry = self.get_resource_by_id(id=args.id, **kwargs) if args.response: instance.response = json.loads(args.response) else: response = InteractiveForm( inquiry.schema.get('properties')).initiate_dialog() instance.response = response # Send the response to the API first, then sanitize secrets instance = self.manager.update(instance, **kwargs) instance = self.sanitize_secrets(instance, inquiry.schema) return instance