def handle(self, request, context): try: group = client.policy_target_create(request, **context) return group except Exception as e: msg = self.format_status_message(self.failure_message) + str(e) exceptions.handle(request, msg) return False
def handle(self, request, context): try: if context.get('name'): context['name'] = html.escape(context['name']) if context.get('description'): context['description'] = html.escape(context['description']) group = client.policy_target_create(request, **context) return group except Exception as e: msg = self.format_status_message(self.failure_message) + str(e) exceptions.handle(request, msg) return False