{"action":"created","comment":{"url":"https://api.github.com/repos/EventMobi/thorium/pulls/comments/23172863","id":23172863,"diff_hunk":"@@ -254,8 +259,10 @@ def _set(self, field_name, value, cast=False):\n         field = self._fields[field_name]\n         if not self._partial and not field.is_readonly and value == NotSet:\n             raise errors.ValidationError('Attempted to set field {0} of a non-partial resource to NotSet'.format(field))\n+        if not field.is_mutable and self.is_set(field_name) and self._get(field_name) != (field.default or value):\n+            raise errors.ValidationError('Attempted to change value of non-mutable field.')","path":"thorium/resources.py","position":46,"original_position":46,"commit_id":"4cb05ec7e461b8f7391ab9b57246fdde01eff2e0","original_commit_id":"4cb05ec7e461b8f7391ab9b57246fdde01eff2e0","user":{"login":"rjeaster","id":2880642,"avatar_url":"https://avatars.githubusercontent.com/u/2880642?v=3","gravatar_id":"","url":"https://api.github.com/users/rjeaster","html_url":"https://github.com/rjeaster","followers_url":"https://api.github.com/users/rjeaster/followers","following_url":"https://api.github.com/users/rjeaster/following{/other_user}","gists_url":"https://api.github.com/users/rjeaster/gists{/gist_id}","starred_url":"https://api.github.com/users/rjeaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjeaster/subscriptions","organizations_url":"https://api.github.com/users/rjeaster/orgs","repos_url":"https://api.github.com/users/rjeaster/repos","events_url":"https://api.github.com/users/rjeaster/events{/privacy}","received_events_url":"https://api.github.com/users/rjeaster/received_events","type":"User","site_admin":false},"body":"The error message here should provide more information, like which field this was attempted on. See above error message for an example.","created_at":"2015-01-19T17:05:51Z","updated_at":"2015-01-19T17:05:51Z","html_url":"https://github.com/EventMobi/thorium/pull/26#discussion_r23172863","pull_request_url":"https://api.github.com/repos/EventMobi/thorium/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/EventMobi/thorium/pulls/comments/23172863"},"html":{"href":"https://github.com/EventMobi/thorium/pull/26#discussion_r23172863"},"pull_request":{"href":"https://api.github.com/repos/EventMobi/thorium/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/EventMobi/thorium/pulls/26","id":27403294,"html_url":"https://github.com/EventMobi/thorium/pull/26","diff_url":"https://github.com/EventMobi/thorium/pull/26.diff","patch_url":"https://github.com/EventMobi/thorium/pull/26.patch","issue_url":"https://api.github.com/repos/EventMobi/thorium/issues/26","number":26,"state":"open","locked":false,"title":"Feature/plat 267 add mutable field attribute","user":{"login":"michael-mao","id":7534721,"avatar_url":"https://avatars.githubusercontent.com/u/7534721?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-mao","html_url":"https://github.com/michael-mao","followers_url":"https://api.github.com/users/michael-mao/followers","following_url":"https://api.github.com/users/michael-mao/following{/other_user}","gists_url":"https://api.github.com/users/michael-mao/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-mao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-mao/subscriptions","organizations_url":"https://api.github.com/users/michael-mao/orgs","repos_url":"https://api.github.com/users/michael-mao/repos","events_url":"https://api.github.com/users/michael-mao/events{/privacy}","received_events_url":"https://api.github.com/users/michael-mao/received_events","type":"User","site_admin":false},"body":"#### What's this PR do?\r\nAdds the `mutable` attribute to fields. Will only allow field value to be set on creation. Raises a `ValidationError` when trying to update a field with `mutable=False`.\r\n\r\n#### What are the relevant tickets?\r\n[PLAT-267 - Add mutable attribute to fields](https://eventmobi.atlassian.net/browse/PLAT-267)\r\n\r\n#### Testing:\r\n- [x] Do you have appropriate unit test coverage?\r\n","created_at":"2015-01-15T03:08:34Z","updated_at":"2015-01-19T17:05:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97d6efb6b07ab033234e9056794269561b4de19c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/EventMobi/thorium/pulls/26/commits","review_comments_url":"https://api.github.com/repos/EventMobi/thorium/pulls/26/comments","review_comment_url":"https://api.github.com/repos/EventMobi/thorium/pulls/comments/{number}","comments_url":"https://api.github.com/repos/EventMobi/thorium/issues/26/comments","statuses_url":"https://api.github.com/repos/EventMobi/thorium/statuses/4cb05ec7e461b8f7391ab9b57246fdde01eff2e0","head":{"label":"EventMobi:feature/PLAT-267-add-mutable-field-attribute","ref":"feature/PLAT-267-add-mutable-field-attribute","sha":"4cb05ec7e461b8f7391ab9b57246fdde01eff2e0","user":{"login":"EventMobi","id":1429976,"avatar_url":"https://avatars.githubusercontent.com/u/1429976?v=3","gravatar_id":"","url":"https://api.github.com/users/EventMobi","html_url":"https://github.com/EventMobi","followers_url":"https://api.github.com/users/EventMobi/followers","following_url":"https://api.github.com/users/EventMobi/following{/other_user}","gists_url":"https://api.github.com/users/EventMobi/gists{/gist_id}","starred_url":"https://api.github.com/users/EventMobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EventMobi/subscriptions","organizations_url":"https://api.github.com/users/EventMobi/orgs","repos_url":"https://api.github.com/users/EventMobi/repos","events_url":"https://api.github.com/users/EventMobi/events{/privacy}","received_events_url":"https://api.github.com/users/EventMobi/received_events","type":"Organization","site_admin":false},"repo":{"id":10464336,"name":"thorium","full_name":"EventMobi/thorium","owner":{"login":"EventMobi","id":1429976,"avatar_url":"https://avatars.githubusercontent.com/u/1429976?v=3","gravatar_id":"","url":"https://api.github.com/users/EventMobi","html_url":"https://github.com/EventMobi","followers_url":"https://api.github.com/users/EventMobi/followers","following_url":"https://api.github.com/users/EventMobi/following{/other_user}","gists_url":"https://api.github.com/users/EventMobi/gists{/gist_id}","starred_url":"https://api.github.com/users/EventMobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EventMobi/subscriptions","organizations_url":"https://api.github.com/users/EventMobi/orgs","repos_url":"https://api.github.com/users/EventMobi/repos","events_url":"https://api.github.com/users/EventMobi/events{/privacy}","received_events_url":"https://api.github.com/users/EventMobi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EventMobi/thorium","description":"A simple RESTful API framework built on Flask.","fork":false,"url":"https://api.github.com/repos/EventMobi/thorium","forks_url":"https://api.github.com/repos/EventMobi/thorium/forks","keys_url":"https://api.github.com/repos/EventMobi/thorium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EventMobi/thorium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EventMobi/thorium/teams","hooks_url":"https://api.github.com/repos/EventMobi/thorium/hooks","issue_events_url":"https://api.github.com/repos/EventMobi/thorium/issues/events{/number}","events_url":"https://api.github.com/repos/EventMobi/thorium/events","assignees_url":"https://api.github.com/repos/EventMobi/thorium/assignees{/user}","branches_url":"https://api.github.com/repos/EventMobi/thorium/branches{/branch}","tags_url":"https://api.github.com/repos/EventMobi/thorium/tags","blobs_url":"https://api.github.com/repos/EventMobi/thorium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EventMobi/thorium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EventMobi/thorium/git/refs{/sha}","trees_url":"https://api.github.com/repos/EventMobi/thorium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EventMobi/thorium/statuses/{sha}","languages_url":"https://api.github.com/repos/EventMobi/thorium/languages","stargazers_url":"https://api.github.com/repos/EventMobi/thorium/stargazers","contributors_url":"https://api.github.com/repos/EventMobi/thorium/contributors","subscribers_url":"https://api.github.com/repos/EventMobi/thorium/subscribers","subscription_url":"https://api.github.com/repos/EventMobi/thorium/subscription","commits_url":"https://api.github.com/repos/EventMobi/thorium/commits{/sha}","git_commits_url":"https://api.github.com/repos/EventMobi/thorium/git/commits{/sha}","comments_url":"https://api.github.com/repos/EventMobi/thorium/comments{/number}","issue_comment_url":"https://api.github.com/repos/EventMobi/thorium/issues/comments/{number}","contents_url":"https://api.github.com/repos/EventMobi/thorium/contents/{+path}","compare_url":"https://api.github.com/repos/EventMobi/thorium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EventMobi/thorium/merges","archive_url":"https://api.github.com/repos/EventMobi/thorium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EventMobi/thorium/downloads","issues_url":"https://api.github.com/repos/EventMobi/thorium/issues{/number}","pulls_url":"https://api.github.com/repos/EventMobi/thorium/pulls{/number}","milestones_url":"https://api.github.com/repos/EventMobi/thorium/milestones{/number}","notifications_url":"https://api.github.com/repos/EventMobi/thorium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EventMobi/thorium/labels{/name}","releases_url":"https://api.github.com/repos/EventMobi/thorium/releases{/id}","created_at":"2013-06-03T20:47:49Z","updated_at":"2015-01-06T18:45:44Z","pushed_at":"2015-01-15T03:27:16Z","git_url":"git://github.com/EventMobi/thorium.git","ssh_url":"git@github.com:EventMobi/thorium.git","clone_url":"https://github.com/EventMobi/thorium.git","svn_url":"https://github.com/EventMobi/thorium","homepage":null,"size":3896,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":11,"default_branch":"master"}},"base":{"label":"EventMobi:master","ref":"master","sha":"b869c6dd1986182496c2bfa93808880bd247df3b","user":{"login":"EventMobi","id":1429976,"avatar_url":"https://avatars.githubusercontent.com/u/1429976?v=3","gravatar_id":"","url":"https://api.github.com/users/EventMobi","html_url":"https://github.com/EventMobi","followers_url":"https://api.github.com/users/EventMobi/followers","following_url":"https://api.github.com/users/EventMobi/following{/other_user}","gists_url":"https://api.github.com/users/EventMobi/gists{/gist_id}","starred_url":"https://api.github.com/users/EventMobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EventMobi/subscriptions","organizations_url":"https://api.github.com/users/EventMobi/orgs","repos_url":"https://api.github.com/users/EventMobi/repos","events_url":"https://api.github.com/users/EventMobi/events{/privacy}","received_events_url":"https://api.github.com/users/EventMobi/received_events","type":"Organization","site_admin":false},"repo":{"id":10464336,"name":"thorium","full_name":"EventMobi/thorium","owner":{"login":"EventMobi","id":1429976,"avatar_url":"https://avatars.githubusercontent.com/u/1429976?v=3","gravatar_id":"","url":"https://api.github.com/users/EventMobi","html_url":"https://github.com/EventMobi","followers_url":"https://api.github.com/users/EventMobi/followers","following_url":"https://api.github.com/users/EventMobi/following{/other_user}","gists_url":"https://api.github.com/users/EventMobi/gists{/gist_id}","starred_url":"https://api.github.com/users/EventMobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EventMobi/subscriptions","organizations_url":"https://api.github.com/users/EventMobi/orgs","repos_url":"https://api.github.com/users/EventMobi/repos","events_url":"https://api.github.com/users/EventMobi/events{/privacy}","received_events_url":"https://api.github.com/users/EventMobi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EventMobi/thorium","description":"A simple RESTful API framework built on Flask.","fork":false,"url":"https://api.github.com/repos/EventMobi/thorium","forks_url":"https://api.github.com/repos/EventMobi/thorium/forks","keys_url":"https://api.github.com/repos/EventMobi/thorium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EventMobi/thorium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EventMobi/thorium/teams","hooks_url":"https://api.github.com/repos/EventMobi/thorium/hooks","issue_events_url":"https://api.github.com/repos/EventMobi/thorium/issues/events{/number}","events_url":"https://api.github.com/repos/EventMobi/thorium/events","assignees_url":"https://api.github.com/repos/EventMobi/thorium/assignees{/user}","branches_url":"https://api.github.com/repos/EventMobi/thorium/branches{/branch}","tags_url":"https://api.github.com/repos/EventMobi/thorium/tags","blobs_url":"https://api.github.com/repos/EventMobi/thorium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EventMobi/thorium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EventMobi/thorium/git/refs{/sha}","trees_url":"https://api.github.com/repos/EventMobi/thorium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EventMobi/thorium/statuses/{sha}","languages_url":"https://api.github.com/repos/EventMobi/thorium/languages","stargazers_url":"https://api.github.com/repos/EventMobi/thorium/stargazers","contributors_url":"https://api.github.com/repos/EventMobi/thorium/contributors","subscribers_url":"https://api.github.com/repos/EventMobi/thorium/subscribers","subscription_url":"https://api.github.com/repos/EventMobi/thorium/subscription","commits_url":"https://api.github.com/repos/EventMobi/thorium/commits{/sha}","git_commits_url":"https://api.github.com/repos/EventMobi/thorium/git/commits{/sha}","comments_url":"https://api.github.com/repos/EventMobi/thorium/comments{/number}","issue_comment_url":"https://api.github.com/repos/EventMobi/thorium/issues/comments/{number}","contents_url":"https://api.github.com/repos/EventMobi/thorium/contents/{+path}","compare_url":"https://api.github.com/repos/EventMobi/thorium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EventMobi/thorium/merges","archive_url":"https://api.github.com/repos/EventMobi/thorium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EventMobi/thorium/downloads","issues_url":"https://api.github.com/repos/EventMobi/thorium/issues{/number}","pulls_url":"https://api.github.com/repos/EventMobi/thorium/pulls{/number}","milestones_url":"https://api.github.com/repos/EventMobi/thorium/milestones{/number}","notifications_url":"https://api.github.com/repos/EventMobi/thorium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EventMobi/thorium/labels{/name}","releases_url":"https://api.github.com/repos/EventMobi/thorium/releases{/id}","created_at":"2013-06-03T20:47:49Z","updated_at":"2015-01-06T18:45:44Z","pushed_at":"2015-01-15T03:27:16Z","git_url":"git://github.com/EventMobi/thorium.git","ssh_url":"git@github.com:EventMobi/thorium.git","clone_url":"https://github.com/EventMobi/thorium.git","svn_url":"https://github.com/EventMobi/thorium","homepage":null,"size":3896,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EventMobi/thorium/pulls/26"},"html":{"href":"https://github.com/EventMobi/thorium/pull/26"},"issue":{"href":"https://api.github.com/repos/EventMobi/thorium/issues/26"},"comments":{"href":"https://api.github.com/repos/EventMobi/thorium/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/EventMobi/thorium/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/EventMobi/thorium/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/EventMobi/thorium/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/EventMobi/thorium/statuses/4cb05ec7e461b8f7391ab9b57246fdde01eff2e0"}}}}