{"action":"opened","number":1845,"pull_request":{"url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1845","id":209268731,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MjY4NzMx","html_url":"https://github.com/MongoEngine/mongoengine/pull/1845","diff_url":"https://github.com/MongoEngine/mongoengine/pull/1845.diff","patch_url":"https://github.com/MongoEngine/mongoengine/pull/1845.patch","issue_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1845","number":1845,"state":"open","locked":false,"title":"remove dead code","user":{"login":"bagerard","id":11854690,"node_id":"MDQ6VXNlcjExODU0Njkw","avatar_url":"https://avatars0.githubusercontent.com/u/11854690?v=4","gravatar_id":"","url":"https://api.github.com/users/bagerard","html_url":"https://github.com/bagerard","followers_url":"https://api.github.com/users/bagerard/followers","following_url":"https://api.github.com/users/bagerard/following{/other_user}","gists_url":"https://api.github.com/users/bagerard/gists{/gist_id}","starred_url":"https://api.github.com/users/bagerard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagerard/subscriptions","organizations_url":"https://api.github.com/users/bagerard/orgs","repos_url":"https://api.github.com/users/bagerard/repos","events_url":"https://api.github.com/users/bagerard/events{/privacy}","received_events_url":"https://api.github.com/users/bagerard/received_events","type":"User","site_admin":false},"body":"While checking something else I've noticed the following dead code:\r\n1)\r\n```\r\n        if self._dynamic:        #  <--\r\n            dynamic_data = {}\r\n            for key, value in values.iteritems():\r\n                if key in self._fields or key == '_id':\r\n                    setattr(self, key, value)\r\n                elif self._dynamic:        #  <-- useless\r\n                    dynamic_data[key] = value\r\n```\r\n\r\n2)\r\n```\r\n       __auto_convert = values.pop('__auto_convert', True)    # <-- pops '__auto_convert' from values\r\n... (more code)\r\n        # Set passed values after initialisation\r\n        if self._dynamic:\r\n            ...\r\n        else:\r\n            FileField = _import_class('FileField')\r\n            for key, value in values.iteritems():\r\n                if key == '__auto_convert':                                   # still checks if '__auto_convert' is there\r\n                    continue\r\n                key = self._reverse_db_field_map.get(key, key)\r\n                if key in self._fields or key in ('id', 'pk', '_cls'):\r\n                    if __auto_convert and value is not None:\r\n                        field = self._fields.get(key)\r\n                        if field and not isinstance(field, FileField):\r\n                            value = field.to_python(value)\r\n                    setattr(self, key, value)\r\n                else:\r\n                    self._data[key] = value\r\n```","created_at":"2018-08-17T22:09:47Z","updated_at":"2018-08-17T22:09:47Z","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/MongoEngine/mongoengine/pulls/1845/commits","review_comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1845/comments","review_comment_url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1845/comments","statuses_url":"https://api.github.com/repos/MongoEngine/mongoengine/statuses/1bcdcce93abdbf1c20410dcde395e20b6987cc2b","head":{"label":"bagerard:clean_dead_code","ref":"clean_dead_code","sha":"1bcdcce93abdbf1c20410dcde395e20b6987cc2b","user":{"login":"bagerard","id":11854690,"node_id":"MDQ6VXNlcjExODU0Njkw","avatar_url":"https://avatars0.githubusercontent.com/u/11854690?v=4","gravatar_id":"","url":"https://api.github.com/users/bagerard","html_url":"https://github.com/bagerard","followers_url":"https://api.github.com/users/bagerard/followers","following_url":"https://api.github.com/users/bagerard/following{/other_user}","gists_url":"https://api.github.com/users/bagerard/gists{/gist_id}","starred_url":"https://api.github.com/users/bagerard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagerard/subscriptions","organizations_url":"https://api.github.com/users/bagerard/orgs","repos_url":"https://api.github.com/users/bagerard/repos","events_url":"https://api.github.com/users/bagerard/events{/privacy}","received_events_url":"https://api.github.com/users/bagerard/received_events","type":"User","site_admin":false},"repo":{"id":50118497,"node_id":"MDEwOlJlcG9zaXRvcnk1MDExODQ5Nw==","name":"mongoengine","full_name":"bagerard/mongoengine","owner":{"login":"bagerard","id":11854690,"node_id":"MDQ6VXNlcjExODU0Njkw","avatar_url":"https://avatars0.githubusercontent.com/u/11854690?v=4","gravatar_id":"","url":"https://api.github.com/users/bagerard","html_url":"https://github.com/bagerard","followers_url":"https://api.github.com/users/bagerard/followers","following_url":"https://api.github.com/users/bagerard/following{/other_user}","gists_url":"https://api.github.com/users/bagerard/gists{/gist_id}","starred_url":"https://api.github.com/users/bagerard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagerard/subscriptions","organizations_url":"https://api.github.com/users/bagerard/orgs","repos_url":"https://api.github.com/users/bagerard/repos","events_url":"https://api.github.com/users/bagerard/events{/privacy}","received_events_url":"https://api.github.com/users/bagerard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bagerard/mongoengine","description":"A Python Object-Document-Mapper for working with MongoDB","fork":true,"url":"https://api.github.com/repos/bagerard/mongoengine","forks_url":"https://api.github.com/repos/bagerard/mongoengine/forks","keys_url":"https://api.github.com/repos/bagerard/mongoengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bagerard/mongoengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bagerard/mongoengine/teams","hooks_url":"https://api.github.com/repos/bagerard/mongoengine/hooks","issue_events_url":"https://api.github.com/repos/bagerard/mongoengine/issues/events{/number}","events_url":"https://api.github.com/repos/bagerard/mongoengine/events","assignees_url":"https://api.github.com/repos/bagerard/mongoengine/assignees{/user}","branches_url":"https://api.github.com/repos/bagerard/mongoengine/branches{/branch}","tags_url":"https://api.github.com/repos/bagerard/mongoengine/tags","blobs_url":"https://api.github.com/repos/bagerard/mongoengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bagerard/mongoengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bagerard/mongoengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/bagerard/mongoengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bagerard/mongoengine/statuses/{sha}","languages_url":"https://api.github.com/repos/bagerard/mongoengine/languages","stargazers_url":"https://api.github.com/repos/bagerard/mongoengine/stargazers","contributors_url":"https://api.github.com/repos/bagerard/mongoengine/contributors","subscribers_url":"https://api.github.com/repos/bagerard/mongoengine/subscribers","subscription_url":"https://api.github.com/repos/bagerard/mongoengine/subscription","commits_url":"https://api.github.com/repos/bagerard/mongoengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/bagerard/mongoengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/bagerard/mongoengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/bagerard/mongoengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/bagerard/mongoengine/contents/{+path}","compare_url":"https://api.github.com/repos/bagerard/mongoengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bagerard/mongoengine/merges","archive_url":"https://api.github.com/repos/bagerard/mongoengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bagerard/mongoengine/downloads","issues_url":"https://api.github.com/repos/bagerard/mongoengine/issues{/number}","pulls_url":"https://api.github.com/repos/bagerard/mongoengine/pulls{/number}","milestones_url":"https://api.github.com/repos/bagerard/mongoengine/milestones{/number}","notifications_url":"https://api.github.com/repos/bagerard/mongoengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bagerard/mongoengine/labels{/name}","releases_url":"https://api.github.com/repos/bagerard/mongoengine/releases{/id}","deployments_url":"https://api.github.com/repos/bagerard/mongoengine/deployments","created_at":"2016-01-21T15:58:36Z","updated_at":"2018-06-12T19:00:17Z","pushed_at":"2018-08-17T22:03:28Z","git_url":"git://github.com/bagerard/mongoengine.git","ssh_url":"git@github.com:bagerard/mongoengine.git","clone_url":"https://github.com/bagerard/mongoengine.git","svn_url":"https://github.com/bagerard/mongoengine","homepage":"http://mongoengine.org","size":5354,"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","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MongoEngine:master","ref":"master","sha":"36c5f02bfb085f3eb35b101f5fc3fec2af02c2df","user":{"login":"MongoEngine","id":1502485,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDI0ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/1502485?v=4","gravatar_id":"","url":"https://api.github.com/users/MongoEngine","html_url":"https://github.com/MongoEngine","followers_url":"https://api.github.com/users/MongoEngine/followers","following_url":"https://api.github.com/users/MongoEngine/following{/other_user}","gists_url":"https://api.github.com/users/MongoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/MongoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MongoEngine/subscriptions","organizations_url":"https://api.github.com/users/MongoEngine/orgs","repos_url":"https://api.github.com/users/MongoEngine/repos","events_url":"https://api.github.com/users/MongoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/MongoEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":3626679,"node_id":"MDEwOlJlcG9zaXRvcnkzNjI2Njc5","name":"mongoengine","full_name":"MongoEngine/mongoengine","owner":{"login":"MongoEngine","id":1502485,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDI0ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/1502485?v=4","gravatar_id":"","url":"https://api.github.com/users/MongoEngine","html_url":"https://github.com/MongoEngine","followers_url":"https://api.github.com/users/MongoEngine/followers","following_url":"https://api.github.com/users/MongoEngine/following{/other_user}","gists_url":"https://api.github.com/users/MongoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/MongoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MongoEngine/subscriptions","organizations_url":"https://api.github.com/users/MongoEngine/orgs","repos_url":"https://api.github.com/users/MongoEngine/repos","events_url":"https://api.github.com/users/MongoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/MongoEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MongoEngine/mongoengine","description":"A Python Object-Document-Mapper for working with MongoDB","fork":false,"url":"https://api.github.com/repos/MongoEngine/mongoengine","forks_url":"https://api.github.com/repos/MongoEngine/mongoengine/forks","keys_url":"https://api.github.com/repos/MongoEngine/mongoengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MongoEngine/mongoengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MongoEngine/mongoengine/teams","hooks_url":"https://api.github.com/repos/MongoEngine/mongoengine/hooks","issue_events_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/events{/number}","events_url":"https://api.github.com/repos/MongoEngine/mongoengine/events","assignees_url":"https://api.github.com/repos/MongoEngine/mongoengine/assignees{/user}","branches_url":"https://api.github.com/repos/MongoEngine/mongoengine/branches{/branch}","tags_url":"https://api.github.com/repos/MongoEngine/mongoengine/tags","blobs_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MongoEngine/mongoengine/statuses/{sha}","languages_url":"https://api.github.com/repos/MongoEngine/mongoengine/languages","stargazers_url":"https://api.github.com/repos/MongoEngine/mongoengine/stargazers","contributors_url":"https://api.github.com/repos/MongoEngine/mongoengine/contributors","subscribers_url":"https://api.github.com/repos/MongoEngine/mongoengine/subscribers","subscription_url":"https://api.github.com/repos/MongoEngine/mongoengine/subscription","commits_url":"https://api.github.com/repos/MongoEngine/mongoengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/MongoEngine/mongoengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/MongoEngine/mongoengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/MongoEngine/mongoengine/contents/{+path}","compare_url":"https://api.github.com/repos/MongoEngine/mongoengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MongoEngine/mongoengine/merges","archive_url":"https://api.github.com/repos/MongoEngine/mongoengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MongoEngine/mongoengine/downloads","issues_url":"https://api.github.com/repos/MongoEngine/mongoengine/issues{/number}","pulls_url":"https://api.github.com/repos/MongoEngine/mongoengine/pulls{/number}","milestones_url":"https://api.github.com/repos/MongoEngine/mongoengine/milestones{/number}","notifications_url":"https://api.github.com/repos/MongoEngine/mongoengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MongoEngine/mongoengine/labels{/name}","releases_url":"https://api.github.com/repos/MongoEngine/mongoengine/releases{/id}","deployments_url":"https://api.github.com/repos/MongoEngine/mongoengine/deployments","created_at":"2012-03-05T12:10:20Z","updated_at":"2018-08-17T13:53:57Z","pushed_at":"2018-08-15T19:41:19Z","git_url":"git://github.com/MongoEngine/mongoengine.git","ssh_url":"git@github.com:MongoEngine/mongoengine.git","clone_url":"https://github.com/MongoEngine/mongoengine.git","svn_url":"https://github.com/MongoEngine/mongoengine","homepage":"http://mongoengine.org","size":6011,"stargazers_count":2396,"watchers_count":2396,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":976,"mirror_url":null,"archived":false,"open_issues_count":418,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":976,"open_issues":418,"watchers":2396,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1845"},"html":{"href":"https://github.com/MongoEngine/mongoengine/pull/1845"},"issue":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1845"},"comments":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/issues/1845/comments"},"review_comments":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1845/comments"},"review_comment":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/pulls/1845/commits"},"statuses":{"href":"https://api.github.com/repos/MongoEngine/mongoengine/statuses/1bcdcce93abdbf1c20410dcde395e20b6987cc2b"}},"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":2,"deletions":4,"changed_files":2}}
{"actor":{"display_login":"bagerard"}}