{"action":"opened","number":5564,"pull_request":{"url":"https://api.github.com/repos/frappe/frappe/pulls/5564","id":188632032,"html_url":"https://github.com/frappe/frappe/pull/5564","diff_url":"https://github.com/frappe/frappe/pull/5564.diff","patch_url":"https://github.com/frappe/frappe/pull/5564.patch","issue_url":"https://api.github.com/repos/frappe/frappe/issues/5564","number":5564,"state":"open","locked":false,"title":"[fix] Button duplication on page trigger: refresh","user":{"login":"sushantnadkar","id":8912289,"avatar_url":"https://avatars3.githubusercontent.com/u/8912289?v=4","gravatar_id":"","url":"https://api.github.com/users/sushantnadkar","html_url":"https://github.com/sushantnadkar","followers_url":"https://api.github.com/users/sushantnadkar/followers","following_url":"https://api.github.com/users/sushantnadkar/following{/other_user}","gists_url":"https://api.github.com/users/sushantnadkar/gists{/gist_id}","starred_url":"https://api.github.com/users/sushantnadkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushantnadkar/subscriptions","organizations_url":"https://api.github.com/users/sushantnadkar/orgs","repos_url":"https://api.github.com/users/sushantnadkar/repos","events_url":"https://api.github.com/users/sushantnadkar/events{/privacy}","received_events_url":"https://api.github.com/users/sushantnadkar/received_events","type":"User","site_admin":false},"body":"## Issue\r\nButtons were duplicated if there was a programmatic trigger to refresh the page.\r\n![image](https://user-images.githubusercontent.com/8912289/40159025-15b98de0-59c5-11e8-9652-4dae894301ed.png)\r\n\r\n### Expected behavior\r\nWhen a form is refreshed in any way, all document buttons should only appear once.\r\n### Actual behavior\r\nWhen a `refresh` is triggered on a page programmatically, instead of keeping a single instance of a button, duplicates are being created.\r\n### Solution\r\nCheck if the button exists or not before creating it, and just return the button instance if it already exists.","created_at":"2018-05-17T06:08:32Z","updated_at":"2018-05-17T06:08:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/frappe/frappe/pulls/5564/commits","review_comments_url":"https://api.github.com/repos/frappe/frappe/pulls/5564/comments","review_comment_url":"https://api.github.com/repos/frappe/frappe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/frappe/frappe/issues/5564/comments","statuses_url":"https://api.github.com/repos/frappe/frappe/statuses/c99588bda8c1a638507d642a1499a9a378075734","head":{"label":"sushantnadkar:btn-duplication-frappe","ref":"btn-duplication-frappe","sha":"c99588bda8c1a638507d642a1499a9a378075734","user":{"login":"sushantnadkar","id":8912289,"avatar_url":"https://avatars3.githubusercontent.com/u/8912289?v=4","gravatar_id":"","url":"https://api.github.com/users/sushantnadkar","html_url":"https://github.com/sushantnadkar","followers_url":"https://api.github.com/users/sushantnadkar/followers","following_url":"https://api.github.com/users/sushantnadkar/following{/other_user}","gists_url":"https://api.github.com/users/sushantnadkar/gists{/gist_id}","starred_url":"https://api.github.com/users/sushantnadkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushantnadkar/subscriptions","organizations_url":"https://api.github.com/users/sushantnadkar/orgs","repos_url":"https://api.github.com/users/sushantnadkar/repos","events_url":"https://api.github.com/users/sushantnadkar/events{/privacy}","received_events_url":"https://api.github.com/users/sushantnadkar/received_events","type":"User","site_admin":false},"repo":{"id":95683455,"name":"frappe","full_name":"sushantnadkar/frappe","owner":{"login":"sushantnadkar","id":8912289,"avatar_url":"https://avatars3.githubusercontent.com/u/8912289?v=4","gravatar_id":"","url":"https://api.github.com/users/sushantnadkar","html_url":"https://github.com/sushantnadkar","followers_url":"https://api.github.com/users/sushantnadkar/followers","following_url":"https://api.github.com/users/sushantnadkar/following{/other_user}","gists_url":"https://api.github.com/users/sushantnadkar/gists{/gist_id}","starred_url":"https://api.github.com/users/sushantnadkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushantnadkar/subscriptions","organizations_url":"https://api.github.com/users/sushantnadkar/orgs","repos_url":"https://api.github.com/users/sushantnadkar/repos","events_url":"https://api.github.com/users/sushantnadkar/events{/privacy}","received_events_url":"https://api.github.com/users/sushantnadkar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sushantnadkar/frappe","description":"Rapid Application Development Framework in Python & JS. Used to build ERPNext","fork":true,"url":"https://api.github.com/repos/sushantnadkar/frappe","forks_url":"https://api.github.com/repos/sushantnadkar/frappe/forks","keys_url":"https://api.github.com/repos/sushantnadkar/frappe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sushantnadkar/frappe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sushantnadkar/frappe/teams","hooks_url":"https://api.github.com/repos/sushantnadkar/frappe/hooks","issue_events_url":"https://api.github.com/repos/sushantnadkar/frappe/issues/events{/number}","events_url":"https://api.github.com/repos/sushantnadkar/frappe/events","assignees_url":"https://api.github.com/repos/sushantnadkar/frappe/assignees{/user}","branches_url":"https://api.github.com/repos/sushantnadkar/frappe/branches{/branch}","tags_url":"https://api.github.com/repos/sushantnadkar/frappe/tags","blobs_url":"https://api.github.com/repos/sushantnadkar/frappe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sushantnadkar/frappe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sushantnadkar/frappe/git/refs{/sha}","trees_url":"https://api.github.com/repos/sushantnadkar/frappe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sushantnadkar/frappe/statuses/{sha}","languages_url":"https://api.github.com/repos/sushantnadkar/frappe/languages","stargazers_url":"https://api.github.com/repos/sushantnadkar/frappe/stargazers","contributors_url":"https://api.github.com/repos/sushantnadkar/frappe/contributors","subscribers_url":"https://api.github.com/repos/sushantnadkar/frappe/subscribers","subscription_url":"https://api.github.com/repos/sushantnadkar/frappe/subscription","commits_url":"https://api.github.com/repos/sushantnadkar/frappe/commits{/sha}","git_commits_url":"https://api.github.com/repos/sushantnadkar/frappe/git/commits{/sha}","comments_url":"https://api.github.com/repos/sushantnadkar/frappe/comments{/number}","issue_comment_url":"https://api.github.com/repos/sushantnadkar/frappe/issues/comments{/number}","contents_url":"https://api.github.com/repos/sushantnadkar/frappe/contents/{+path}","compare_url":"https://api.github.com/repos/sushantnadkar/frappe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sushantnadkar/frappe/merges","archive_url":"https://api.github.com/repos/sushantnadkar/frappe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sushantnadkar/frappe/downloads","issues_url":"https://api.github.com/repos/sushantnadkar/frappe/issues{/number}","pulls_url":"https://api.github.com/repos/sushantnadkar/frappe/pulls{/number}","milestones_url":"https://api.github.com/repos/sushantnadkar/frappe/milestones{/number}","notifications_url":"https://api.github.com/repos/sushantnadkar/frappe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sushantnadkar/frappe/labels{/name}","releases_url":"https://api.github.com/repos/sushantnadkar/frappe/releases{/id}","deployments_url":"https://api.github.com/repos/sushantnadkar/frappe/deployments","created_at":"2017-06-28T15:19:34Z","updated_at":"2017-06-28T15:19:41Z","pushed_at":"2018-05-17T05:45:20Z","git_url":"git://github.com/sushantnadkar/frappe.git","ssh_url":"git@github.com:sushantnadkar/frappe.git","clone_url":"https://github.com/sushantnadkar/frappe.git","svn_url":"https://github.com/sushantnadkar/frappe","homepage":"http://frappe.io","size":163591,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"frappe:develop","ref":"develop","sha":"a2e1af2a5549ecad5f66068c70e886b7ca29c763","user":{"login":"frappe","id":836974,"avatar_url":"https://avatars2.githubusercontent.com/u/836974?v=4","gravatar_id":"","url":"https://api.github.com/users/frappe","html_url":"https://github.com/frappe","followers_url":"https://api.github.com/users/frappe/followers","following_url":"https://api.github.com/users/frappe/following{/other_user}","gists_url":"https://api.github.com/users/frappe/gists{/gist_id}","starred_url":"https://api.github.com/users/frappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frappe/subscriptions","organizations_url":"https://api.github.com/users/frappe/orgs","repos_url":"https://api.github.com/users/frappe/repos","events_url":"https://api.github.com/users/frappe/events{/privacy}","received_events_url":"https://api.github.com/users/frappe/received_events","type":"Organization","site_admin":false},"repo":{"id":1864194,"name":"frappe","full_name":"frappe/frappe","owner":{"login":"frappe","id":836974,"avatar_url":"https://avatars2.githubusercontent.com/u/836974?v=4","gravatar_id":"","url":"https://api.github.com/users/frappe","html_url":"https://github.com/frappe","followers_url":"https://api.github.com/users/frappe/followers","following_url":"https://api.github.com/users/frappe/following{/other_user}","gists_url":"https://api.github.com/users/frappe/gists{/gist_id}","starred_url":"https://api.github.com/users/frappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frappe/subscriptions","organizations_url":"https://api.github.com/users/frappe/orgs","repos_url":"https://api.github.com/users/frappe/repos","events_url":"https://api.github.com/users/frappe/events{/privacy}","received_events_url":"https://api.github.com/users/frappe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/frappe/frappe","description":"Full Stack Web Framework in Python & JS. Used to build ERPNext","fork":false,"url":"https://api.github.com/repos/frappe/frappe","forks_url":"https://api.github.com/repos/frappe/frappe/forks","keys_url":"https://api.github.com/repos/frappe/frappe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frappe/frappe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frappe/frappe/teams","hooks_url":"https://api.github.com/repos/frappe/frappe/hooks","issue_events_url":"https://api.github.com/repos/frappe/frappe/issues/events{/number}","events_url":"https://api.github.com/repos/frappe/frappe/events","assignees_url":"https://api.github.com/repos/frappe/frappe/assignees{/user}","branches_url":"https://api.github.com/repos/frappe/frappe/branches{/branch}","tags_url":"https://api.github.com/repos/frappe/frappe/tags","blobs_url":"https://api.github.com/repos/frappe/frappe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frappe/frappe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frappe/frappe/git/refs{/sha}","trees_url":"https://api.github.com/repos/frappe/frappe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frappe/frappe/statuses/{sha}","languages_url":"https://api.github.com/repos/frappe/frappe/languages","stargazers_url":"https://api.github.com/repos/frappe/frappe/stargazers","contributors_url":"https://api.github.com/repos/frappe/frappe/contributors","subscribers_url":"https://api.github.com/repos/frappe/frappe/subscribers","subscription_url":"https://api.github.com/repos/frappe/frappe/subscription","commits_url":"https://api.github.com/repos/frappe/frappe/commits{/sha}","git_commits_url":"https://api.github.com/repos/frappe/frappe/git/commits{/sha}","comments_url":"https://api.github.com/repos/frappe/frappe/comments{/number}","issue_comment_url":"https://api.github.com/repos/frappe/frappe/issues/comments{/number}","contents_url":"https://api.github.com/repos/frappe/frappe/contents/{+path}","compare_url":"https://api.github.com/repos/frappe/frappe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frappe/frappe/merges","archive_url":"https://api.github.com/repos/frappe/frappe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frappe/frappe/downloads","issues_url":"https://api.github.com/repos/frappe/frappe/issues{/number}","pulls_url":"https://api.github.com/repos/frappe/frappe/pulls{/number}","milestones_url":"https://api.github.com/repos/frappe/frappe/milestones{/number}","notifications_url":"https://api.github.com/repos/frappe/frappe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frappe/frappe/labels{/name}","releases_url":"https://api.github.com/repos/frappe/frappe/releases{/id}","deployments_url":"https://api.github.com/repos/frappe/frappe/deployments","created_at":"2011-06-08T08:14:16Z","updated_at":"2018-05-16T16:06:50Z","pushed_at":"2018-05-17T03:38:15Z","git_url":"git://github.com/frappe/frappe.git","ssh_url":"git@github.com:frappe/frappe.git","clone_url":"https://github.com/frappe/frappe.git","svn_url":"https://github.com/frappe/frappe","homepage":"http://frappe.io","size":161316,"stargazers_count":895,"watchers_count":895,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":712,"mirror_url":null,"archived":false,"open_issues_count":267,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":712,"open_issues":267,"watchers":895,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/frappe/frappe/pulls/5564"},"html":{"href":"https://github.com/frappe/frappe/pull/5564"},"issue":{"href":"https://api.github.com/repos/frappe/frappe/issues/5564"},"comments":{"href":"https://api.github.com/repos/frappe/frappe/issues/5564/comments"},"review_comments":{"href":"https://api.github.com/repos/frappe/frappe/pulls/5564/comments"},"review_comment":{"href":"https://api.github.com/repos/frappe/frappe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/frappe/frappe/pulls/5564/commits"},"statuses":{"href":"https://api.github.com/repos/frappe/frappe/statuses/c99588bda8c1a638507d642a1499a9a378075734"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":12,"deletions":4,"changed_files":2}}
{"actor":{"display_login":"sushantnadkar"}}