{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/26319170","id":26319170,"diff_hunk":"@@ -0,0 +1,100 @@\n+\"\"\"\n+Errors thrown by the various user APIs.\n+\"\"\"\n+\n+\n+class UserAPIRequestError(Exception):\n+    \"\"\"There was a problem with the request to the User API. \"\"\"\n+    pass\n+\n+\n+class UserAPIInternalError(Exception):\n+    \"\"\"An internal error occurred in the User API. \"\"\"\n+    pass\n+\n+\n+class UserNotFound(UserAPIRequestError):\n+    \"\"\"The requested user does not exist. \"\"\"\n+    pass\n+\n+\n+class UserNotAuthorized(UserAPIRequestError):\n+    \"\"\"The user is not authorized to perform the requested action. \"\"\"\n+    pass\n+\n+\n+class AccountRequestError(UserAPIRequestError):\n+    \"\"\"There was a problem with the request to the account API. \"\"\"\n+    pass\n+\n+\n+class AccountUserAlreadyExists(AccountRequestError):\n+    \"\"\"User with the same username and/or email already exists. \"\"\"\n+    pass\n+\n+\n+class AccountUsernameInvalid(AccountRequestError):\n+    \"\"\"The requested username is not in a valid format. \"\"\"\n+    pass\n+\n+\n+class AccountEmailInvalid(AccountRequestError):\n+    \"\"\"The requested email is not in a valid format. \"\"\"\n+    pass\n+\n+\n+class AccountPasswordInvalid(AccountRequestError):\n+    \"\"\"The requested password is not in a valid format. \"\"\"\n+    pass\n+\n+\n+class AccountUpdateError(AccountRequestError):\n+    \"\"\"\n+    An update to the account failed. More detailed information is present in developer_message,\n+    and depending on the type of error encountered, there may also be a non-null user_message field.\n+    \"\"\"\n+    def __init__(self, developer_message, user_message=None):\n+        self.developer_message = developer_message\n+        self.user_message = user_message\n+\n+\n+class AccountValidationError(AccountRequestError):\n+    \"\"\"\n+    Validation issues were found with the supplied data. More detailed information is present in field_errors,\n+    a dict with specific information about each field that failed validation. For each field,\n+    there will be at least a developer_message describing the validation issue, and possibly\n+    also a user_message.\n+    \"\"\"\n+    def __init__(self, field_errors):\n+        self.field_errors = field_errors\n+\n+\n+class PreferenceRequestError(UserAPIRequestError):\n+    \"\"\"There was a problem with a preference request.\"\"\"\n+    pass\n+\n+\n+class PreferenceNotFound(PreferenceRequestError):\n+    \"\"\"The desired user preference was not found.\"\"\"\n+    pass\n+\n+\n+class PreferenceValidationError(PreferenceRequestError):\n+    \"\"\"\n+    Validation issues were found with the supplied data. More detailed information is present\n+    in preference_errors, a dict with specific information about each preference that failed\n+    validation. For each preference, there will be at least a developer_message describing\n+    the validation issue, and possibly also a user_message.\n+    \"\"\"\n+    def __init__(self, preference_errors):\n+        self.preference_errors = preference_errors\n+\n+\n+class PreferenceUpdateError(PreferenceRequestError):\n+    \"\"\"\n+    An update to the account failed. More detailed information is present in developer_message,\n+    and depending on the type of error encountered, there may also be a non-null user_message field.\n+    \"\"\"\n+    def __init__(self, developer_message, user_message=None):\n+        self.developer_message = developer_message\n+        self.user_message = user_message","path":"openedx/core/djangoapps/user_api/errors.py","position":100,"original_position":100,"commit_id":"97db8f435f97ce4ed4ab5662a869f934d951d446","original_commit_id":"97db8f435f97ce4ed4ab5662a869f934d951d446","user":{"login":"cahrens","id":484484,"avatar_url":"https://avatars.githubusercontent.com/u/484484?v=3","gravatar_id":"","url":"https://api.github.com/users/cahrens","html_url":"https://github.com/cahrens","followers_url":"https://api.github.com/users/cahrens/followers","following_url":"https://api.github.com/users/cahrens/following{/other_user}","gists_url":"https://api.github.com/users/cahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/cahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahrens/subscriptions","organizations_url":"https://api.github.com/users/cahrens/orgs","repos_url":"https://api.github.com/users/cahrens/repos","events_url":"https://api.github.com/users/cahrens/events{/privacy}","received_events_url":"https://api.github.com/users/cahrens/received_events","type":"User","site_admin":false},"body":"I don't get why we still aren't getting pylint/pep8 errors for things like this.","created_at":"2015-03-12T16:36:26Z","updated_at":"2015-03-12T16:36:26Z","html_url":"https://github.com/edx/edx-platform/pull/7327#discussion_r26319170","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/7327","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/26319170"},"html":{"href":"https://github.com/edx/edx-platform/pull/7327#discussion_r26319170"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7327"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/7327","id":31050843,"html_url":"https://github.com/edx/edx-platform/pull/7327","diff_url":"https://github.com/edx/edx-platform/pull/7327.diff","patch_url":"https://github.com/edx/edx-platform/pull/7327.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/7327","number":7327,"state":"open","locked":false,"title":"Andya/preferences api","user":{"login":"cahrens","id":484484,"avatar_url":"https://avatars.githubusercontent.com/u/484484?v=3","gravatar_id":"","url":"https://api.github.com/users/cahrens","html_url":"https://github.com/cahrens","followers_url":"https://api.github.com/users/cahrens/followers","following_url":"https://api.github.com/users/cahrens/following{/other_user}","gists_url":"https://api.github.com/users/cahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/cahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahrens/subscriptions","organizations_url":"https://api.github.com/users/cahrens/orgs","repos_url":"https://api.github.com/users/cahrens/repos","events_url":"https://api.github.com/users/cahrens/events{/privacy}","received_events_url":"https://api.github.com/users/cahrens/received_events","type":"User","site_admin":false},"body":"Replaces #7279.","created_at":"2015-03-12T16:07:59Z","updated_at":"2015-03-12T16:36:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5983502cdc2033223a8131800cc80b885dbed0d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/7327/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/7327/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/7327/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/97db8f435f97ce4ed4ab5662a869f934d951d446","head":{"label":"edx:andya/preferences-api","ref":"andya/preferences-api","sha":"97db8f435f97ce4ed4ab5662a869f934d951d446","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-03-12T15:25:28Z","pushed_at":"2015-03-12T16:34:22Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://openedx.org/","size":1814907,"stargazers_count":1787,"watchers_count":1787,"language":"Gettext Catalog","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1020,"mirror_url":null,"open_issues_count":146,"forks":1020,"open_issues":146,"watchers":1787,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"d7fd454bcedf4f9cbf1a02b4b9d45f40b3dbb6d8","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-03-12T15:25:28Z","pushed_at":"2015-03-12T16:34:22Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://openedx.org/","size":1814907,"stargazers_count":1787,"watchers_count":1787,"language":"Gettext Catalog","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1020,"mirror_url":null,"open_issues_count":146,"forks":1020,"open_issues":146,"watchers":1787,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7327"},"html":{"href":"https://github.com/edx/edx-platform/pull/7327"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/7327"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/7327/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7327/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7327/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/97db8f435f97ce4ed4ab5662a869f934d951d446"}}}}