{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/41116497","id":41116497,"diff_hunk":"@@ -120,6 +123,10 @@ function(Backbone, _, str, gettext, GroupModel, GroupCollection) {\n                     };\n                 }\n             }\n+        },\n+\n+        groupRemoved: function () {\n+            this.setOriginalAttributes();","path":"cms/static/js/models/group_configuration.js","position":19,"original_position":19,"commit_id":"6cc8c47ca00feb6a0135af1103fd064603847edc","original_commit_id":"6cc8c47ca00feb6a0135af1103fd064603847edc","user":{"login":"afeef","id":1297612,"avatar_url":"https://avatars.githubusercontent.com/u/1297612?v=3","gravatar_id":"","url":"https://api.github.com/users/afeef","html_url":"https://github.com/afeef","followers_url":"https://api.github.com/users/afeef/followers","following_url":"https://api.github.com/users/afeef/following{/other_user}","gists_url":"https://api.github.com/users/afeef/gists{/gist_id}","starred_url":"https://api.github.com/users/afeef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeef/subscriptions","organizations_url":"https://api.github.com/users/afeef/orgs","repos_url":"https://api.github.com/users/afeef/repos","events_url":"https://api.github.com/users/afeef/events{/privacy}","received_events_url":"https://api.github.com/users/afeef/received_events","type":"User","site_admin":false},"body":"@cahrens No the attributes won't be set back to the default case. the ```this.setOriginalAttributes(); ``` function is just setting the current state of attributes of group configuration and related groups.\r\n\r\nSo if you add two groups into the group configuration it will contains two objects in the related groups collection. The issues was occurring because when you delete one of them the object is deleted from the server but the group collection count stays at two. So after deleting the group if you call  ```setOriginalAttributes() {  this._originalAttributes = this.parse(this.toJSON()); })``` it will set the group count to one. Because ```this.toJSON()``` returns the current state of the object at any point and not the default state\r\n\r\nAlso why mark ```group_configuration``` model dirty when the  ```group``` object is already deleted on the server?","created_at":"2015-10-05T07:34:03Z","updated_at":"2015-10-05T07:34:03Z","html_url":"https://github.com/edx/edx-platform/pull/10015#discussion_r41116497","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/10015","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/41116497"},"html":{"href":"https://github.com/edx/edx-platform/pull/10015#discussion_r41116497"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10015"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/10015","id":46633526,"html_url":"https://github.com/edx/edx-platform/pull/10015","diff_url":"https://github.com/edx/edx-platform/pull/10015.diff","patch_url":"https://github.com/edx/edx-platform/pull/10015.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/10015","number":10015,"state":"open","locked":false,"title":"TNL-3258 Reset group configuration model when a child content group i…","user":{"login":"afeef","id":1297612,"avatar_url":"https://avatars.githubusercontent.com/u/1297612?v=3","gravatar_id":"","url":"https://api.github.com/users/afeef","html_url":"https://github.com/afeef","followers_url":"https://api.github.com/users/afeef/followers","following_url":"https://api.github.com/users/afeef/following{/other_user}","gists_url":"https://api.github.com/users/afeef/gists{/gist_id}","starred_url":"https://api.github.com/users/afeef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afeef/subscriptions","organizations_url":"https://api.github.com/users/afeef/orgs","repos_url":"https://api.github.com/users/afeef/repos","events_url":"https://api.github.com/users/afeef/events{/privacy}","received_events_url":"https://api.github.com/users/afeef/received_events","type":"User","site_admin":false},"body":"…s deleted (+5 squashed commits)\r\n\r\nThis would fix issues reported in [TNL-3258](https://openedx.atlassian.net/browse/TNL-3258) and [TNL-3441](https://openedx.atlassian.net/browse/TNL-3441)\r\n\r\n@cahrens \r\n@andy-armstrong \r\n\r\nPlease review.\r\n\r\n@waheedahmed FYI","created_at":"2015-10-02T13:12:31Z","updated_at":"2015-10-05T07:34:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"727d672174ad3d1ef3ab19556925a24c108cdf6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/10015/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/10015/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/10015/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/6cc8c47ca00feb6a0135af1103fd064603847edc","head":{"label":"edx:afeef/bugfix/tnl-3258-fix-confirm-navigation-popup-unmodified-group-configurations","ref":"afeef/bugfix/tnl-3258-fix-confirm-navigation-popup-unmodified-group-configurations","sha":"6cc8c47ca00feb6a0135af1103fd064603847edc","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":"The Open edX platform, the software that powers edX!","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-10-03T18:08:32Z","pushed_at":"2015-10-05T04:47:20Z","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://open.edx.org/","size":2123833,"stargazers_count":2155,"watchers_count":2155,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1290,"mirror_url":null,"open_issues_count":134,"forks":1290,"open_issues":134,"watchers":2155,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"0219e18fa829fd16be6c2a6ff0bd87425c91b58d","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":"The Open edX platform, the software that powers edX!","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-10-03T18:08:32Z","pushed_at":"2015-10-05T04:47:20Z","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://open.edx.org/","size":2123833,"stargazers_count":2155,"watchers_count":2155,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1290,"mirror_url":null,"open_issues_count":134,"forks":1290,"open_issues":134,"watchers":2155,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10015"},"html":{"href":"https://github.com/edx/edx-platform/pull/10015"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10015"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/10015/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/10015/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/10015/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/6cc8c47ca00feb6a0135af1103fd064603847edc"}}}}