{"action":"opened","issue":{"url":"https://api.github.com/repos/peoplepattern/crowdflower/issues/7","repository_url":"https://api.github.com/repos/peoplepattern/crowdflower","labels_url":"https://api.github.com/repos/peoplepattern/crowdflower/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/peoplepattern/crowdflower/issues/7/comments","events_url":"https://api.github.com/repos/peoplepattern/crowdflower/issues/7/events","html_url":"https://github.com/peoplepattern/crowdflower/issues/7","id":131467949,"number":7,"title":"code revisions required","user":{"login":"bowlesbe","id":4032715,"avatar_url":"https://avatars.githubusercontent.com/u/4032715?v=3","gravatar_id":"","url":"https://api.github.com/users/bowlesbe","html_url":"https://github.com/bowlesbe","followers_url":"https://api.github.com/users/bowlesbe/followers","following_url":"https://api.github.com/users/bowlesbe/following{/other_user}","gists_url":"https://api.github.com/users/bowlesbe/gists{/gist_id}","starred_url":"https://api.github.com/users/bowlesbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bowlesbe/subscriptions","organizations_url":"https://api.github.com/users/bowlesbe/orgs","repos_url":"https://api.github.com/users/bowlesbe/repos","events_url":"https://api.github.com/users/bowlesbe/events{/privacy}","received_events_url":"https://api.github.com/users/bowlesbe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-04T20:41:02Z","updated_at":"2016-02-04T20:41:02Z","closed_at":null,"body":"No problems with hacky code but maybe we can make sure \"res\" is returned because right now there are no constraints on this.\r\nCheers\r\nBen\r\n\r\nMaybe this and then catch the error in our own programs.\r\n```\r\n        params = rails_params({'job': props})\r\n        logger.debug('Updating Job[%d]: %r', self.id, params)\r\n\r\n        # try:\r\n        res = self._connection.request('/jobs/%s' % self.id, method='PUT', params=params)\r\n\r\n        # reset cached properties\r\n        self._cache_flush('properties')\r\n\r\n        return res\r\n```     \r\n```\r\ndef update(self, props):\r\n        params = rails_params({'job': props})\r\n        logger.debug('Updating Job[%d]: %r', self.id, params)\r\n\r\n        try:\r\n            res = self._connection.request('/jobs/%s' % self.id, method='PUT', params=params)\r\n        except CrowdFlowerError, exc:\r\n            # CrowdFlower sometimes likes to redirect the PUT to a non-API page,\r\n            # which will raise an error (406 Not Accepted), but we can just\r\n            # ignore the error since it comes after the update is complete.\r\n            # This is kind of a hack, since we sometimes want to follow redirects\r\n            # (e.g., with downloads), but following redirects is more properly\r\n            # not the default\r\n            if exc.response.status_code != 406:\r\n                logger.info('Ignoring 406 \"Not Accepted\" error: %r', exc);\r\n            else:\r\n                raise\r\n\r\n        # reset cached properties\r\n        self._cache_flush('properties')\r\n\r\n        return res\r\n```"}}