{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/26442558","id":26442558,"diff_hunk":"@@ -531,3 +534,51 @@ def test_relative_include_exploit(self):\n         ]\n         for disallowed_path in disallowed_paths:\n             self.assertEqual(self.render_ssi(disallowed_path), '')\n+\n+\n+class VariableResolveLoggingTests(unittest.TestCase):\n+    def setUp(self):\n+        self.test_handler = TestHandler()\n+        self.logger = logging.getLogger('django.template')\n+        self.original_level = self.logger.level\n+        self.logger.addHandler(self.test_handler)\n+        self.logger.setLevel(logging.WARNING)\n+\n+    def tearDown(self):\n+        self.logger.removeHandler(self.test_handler)\n+        self.logger.level = self.original_level\n+\n+    def test_log_on_variable_does_not_exist_silent(self):\n+        class TestObject(object):\n+            class SilentDoesNotExist(Exception):\n+                silent_variable_failure = True\n+\n+            @property\n+            def template_name(self):\n+                return \"template\"\n+\n+            @property\n+            def article(self):\n+                raise TestObject.SilentDoesNotExist(\"Attribute does not exist.\")\n+\n+            def __iter__(self):\n+                return iter([attr for attr in dir(TestObject) if attr[:2] != \"__\"])\n+\n+        c = TestObject()\n+        Variable('article').resolve(c)\n+        self.assertEqual(self.test_handler.log_record.msg,","path":"tests/template_tests/tests.py","position":59,"original_position":59,"commit_id":"01829cf8286034b587fc9eef29b0520c2d263608","original_commit_id":"01829cf8286034b587fc9eef29b0520c2d263608","user":{"login":"timgraham","id":411869,"avatar_url":"https://avatars.githubusercontent.com/u/411869?v=3","gravatar_id":"","url":"https://api.github.com/users/timgraham","html_url":"https://github.com/timgraham","followers_url":"https://api.github.com/users/timgraham/followers","following_url":"https://api.github.com/users/timgraham/following{/other_user}","gists_url":"https://api.github.com/users/timgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/timgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgraham/subscriptions","organizations_url":"https://api.github.com/users/timgraham/orgs","repos_url":"https://api.github.com/users/timgraham/repos","events_url":"https://api.github.com/users/timgraham/events{/privacy}","received_events_url":"https://api.github.com/users/timgraham/received_events","type":"User","site_admin":false},"body":"prefer hanging indent style:\r\n```\r\nself.assertEqual(\r\n    ...,\r\n    ...\r\n)\r\n```","created_at":"2015-03-14T22:44:31Z","updated_at":"2015-03-14T22:44:31Z","html_url":"https://github.com/django/django/pull/3942#discussion_r26442558","pull_request_url":"https://api.github.com/repos/django/django/pulls/3942","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/26442558"},"html":{"href":"https://github.com/django/django/pull/3942#discussion_r26442558"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/3942"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/3942","id":27560316,"html_url":"https://github.com/django/django/pull/3942","diff_url":"https://github.com/django/django/pull/3942.diff","patch_url":"https://github.com/django/django/pull/3942.patch","issue_url":"https://api.github.com/repos/django/django/issues/3942","number":3942,"state":"open","locked":false,"title":"Fixed #18773 -- Add logging for template variable resolving","user":{"login":"cpsimpson","id":816496,"avatar_url":"https://avatars.githubusercontent.com/u/816496?v=3","gravatar_id":"","url":"https://api.github.com/users/cpsimpson","html_url":"https://github.com/cpsimpson","followers_url":"https://api.github.com/users/cpsimpson/followers","following_url":"https://api.github.com/users/cpsimpson/following{/other_user}","gists_url":"https://api.github.com/users/cpsimpson/gists{/gist_id}","starred_url":"https://api.github.com/users/cpsimpson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpsimpson/subscriptions","organizations_url":"https://api.github.com/users/cpsimpson/orgs","repos_url":"https://api.github.com/users/cpsimpson/repos","events_url":"https://api.github.com/users/cpsimpson/events{/privacy}","received_events_url":"https://api.github.com/users/cpsimpson/received_events","type":"User","site_admin":false},"body":"Added a django.template logger with a default console handler.  Added\r\nlogging if there is an exception while resolving variables in a\r\ntemplate. Added corresponding tests and updated logging\r\ndocumentation. Updated AdminField to prevent colsole output about\r\nis_readonly not being defined.","created_at":"2015-01-17T18:38:34Z","updated_at":"2015-03-14T22:44:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10edd985b3991bda181ed0b04ff2400c3bee8e1e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/3942/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/3942/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/3942/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/01829cf8286034b587fc9eef29b0520c2d263608","head":{"label":"cpsimpson:ticket_18773","ref":"ticket_18773","sha":"01829cf8286034b587fc9eef29b0520c2d263608","user":{"login":"cpsimpson","id":816496,"avatar_url":"https://avatars.githubusercontent.com/u/816496?v=3","gravatar_id":"","url":"https://api.github.com/users/cpsimpson","html_url":"https://github.com/cpsimpson","followers_url":"https://api.github.com/users/cpsimpson/followers","following_url":"https://api.github.com/users/cpsimpson/following{/other_user}","gists_url":"https://api.github.com/users/cpsimpson/gists{/gist_id}","starred_url":"https://api.github.com/users/cpsimpson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpsimpson/subscriptions","organizations_url":"https://api.github.com/users/cpsimpson/orgs","repos_url":"https://api.github.com/users/cpsimpson/repos","events_url":"https://api.github.com/users/cpsimpson/events{/privacy}","received_events_url":"https://api.github.com/users/cpsimpson/received_events","type":"User","site_admin":false},"repo":{"id":18762650,"name":"django","full_name":"cpsimpson/django","owner":{"login":"cpsimpson","id":816496,"avatar_url":"https://avatars.githubusercontent.com/u/816496?v=3","gravatar_id":"","url":"https://api.github.com/users/cpsimpson","html_url":"https://github.com/cpsimpson","followers_url":"https://api.github.com/users/cpsimpson/followers","following_url":"https://api.github.com/users/cpsimpson/following{/other_user}","gists_url":"https://api.github.com/users/cpsimpson/gists{/gist_id}","starred_url":"https://api.github.com/users/cpsimpson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpsimpson/subscriptions","organizations_url":"https://api.github.com/users/cpsimpson/orgs","repos_url":"https://api.github.com/users/cpsimpson/repos","events_url":"https://api.github.com/users/cpsimpson/events{/privacy}","received_events_url":"https://api.github.com/users/cpsimpson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cpsimpson/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/cpsimpson/django","forks_url":"https://api.github.com/repos/cpsimpson/django/forks","keys_url":"https://api.github.com/repos/cpsimpson/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cpsimpson/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cpsimpson/django/teams","hooks_url":"https://api.github.com/repos/cpsimpson/django/hooks","issue_events_url":"https://api.github.com/repos/cpsimpson/django/issues/events{/number}","events_url":"https://api.github.com/repos/cpsimpson/django/events","assignees_url":"https://api.github.com/repos/cpsimpson/django/assignees{/user}","branches_url":"https://api.github.com/repos/cpsimpson/django/branches{/branch}","tags_url":"https://api.github.com/repos/cpsimpson/django/tags","blobs_url":"https://api.github.com/repos/cpsimpson/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cpsimpson/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cpsimpson/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/cpsimpson/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cpsimpson/django/statuses/{sha}","languages_url":"https://api.github.com/repos/cpsimpson/django/languages","stargazers_url":"https://api.github.com/repos/cpsimpson/django/stargazers","contributors_url":"https://api.github.com/repos/cpsimpson/django/contributors","subscribers_url":"https://api.github.com/repos/cpsimpson/django/subscribers","subscription_url":"https://api.github.com/repos/cpsimpson/django/subscription","commits_url":"https://api.github.com/repos/cpsimpson/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/cpsimpson/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/cpsimpson/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/cpsimpson/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/cpsimpson/django/contents/{+path}","compare_url":"https://api.github.com/repos/cpsimpson/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cpsimpson/django/merges","archive_url":"https://api.github.com/repos/cpsimpson/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cpsimpson/django/downloads","issues_url":"https://api.github.com/repos/cpsimpson/django/issues{/number}","pulls_url":"https://api.github.com/repos/cpsimpson/django/pulls{/number}","milestones_url":"https://api.github.com/repos/cpsimpson/django/milestones{/number}","notifications_url":"https://api.github.com/repos/cpsimpson/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cpsimpson/django/labels{/name}","releases_url":"https://api.github.com/repos/cpsimpson/django/releases{/id}","created_at":"2014-04-14T14:02:13Z","updated_at":"2015-01-17T03:21:54Z","pushed_at":"2015-02-06T23:41:07Z","git_url":"git://github.com/cpsimpson/django.git","ssh_url":"git@github.com:cpsimpson/django.git","clone_url":"https://github.com/cpsimpson/django.git","svn_url":"https://github.com/cpsimpson/django","homepage":"http://www.djangoproject.com/","size":115721,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"bd691f4586c8ad45bd059ff9d3621cbf8afdcdce","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","created_at":"2012-04-28T02:47:18Z","updated_at":"2015-03-14T22:13:46Z","pushed_at":"2015-03-14T20:20:56Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":265967,"stargazers_count":13285,"watchers_count":13285,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5209,"mirror_url":null,"open_issues_count":84,"forks":5209,"open_issues":84,"watchers":13285,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/3942"},"html":{"href":"https://github.com/django/django/pull/3942"},"issue":{"href":"https://api.github.com/repos/django/django/issues/3942"},"comments":{"href":"https://api.github.com/repos/django/django/issues/3942/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/3942/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/3942/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/01829cf8286034b587fc9eef29b0520c2d263608"}}}}