def api_transform_profile_id_delete(id=None, auth_user=None, api_core=None, request=None): u"""Delete a transformation profile.""" profile = api_core.get_transform_profile(spec={u'_id': id}) if not profile: raise IndexError(to_bytes(u'No transformation profile with id {0}.'.format(id))) api_core.delete_transform_profile(profile) return ok_200(u'The transformation profile "{0}" has been deleted.'.format(profile.title), include_properties=False)
def view_transform_profiles_delete(request, id): u"""Delete a transformation profile.""" try: profile = api_core.get_transform_profile(spec={u'_id': id}) if not profile: return {u'errors': [u'No transformation profile with id {0}.'.format(id)]} api_core.delete_transform_profile(profile) return {u'infos': [u'The transformation profile "{0}" has been deleted.'.format(profile.title)]} except Exception as e: logging.exception(e) return {u'errors': [unicode(e)]}