{"action":"created","comment":{"url":"https://api.github.com/repos/littleweaver/django-brambling/pulls/comments/43416454","id":43416454,"diff_hunk":"@@ -1232,13 +1234,18 @@ def refund(self, amount=None, bought_items=None, issuer=None, dwolla_pin=None):\n         if bought_items is None:\n             bought_items = self.bought_items.all()\n \n-        total_refunds = self.related_transaction_set.aggregate(Sum('amount'))['amount__sum'] or 0\n-        refundable = self.amount + total_refunds\n-        if refundable < amount:\n-            raise ValueError(\"Not enough money available\")\n+        total_refunds = self.related_transaction_set.aggregate(Sum('amount'))['amount__sum']\n+        if total_refunds is not None:\n+            refundable = self.amount + total_refunds\n+            if refundable == 0:\n+                return None\n \n-        if refundable == 0:\n-            return None\n+            # SB: Pretty sure this just disables completing partial\n+            # refunds.\n+            if refundable < amount:\n+                raise ValueError(\"Not enough money available\")","path":"brambling/models.py","position":32,"original_position":32,"commit_id":"611d6b02e8c3694ace2090ce11ac898d5678f316","original_commit_id":"611d6b02e8c3694ace2090ce11ac898d5678f316","user":{"login":"melinath","id":299979,"avatar_url":"https://avatars.githubusercontent.com/u/299979?v=3","gravatar_id":"","url":"https://api.github.com/users/melinath","html_url":"https://github.com/melinath","followers_url":"https://api.github.com/users/melinath/followers","following_url":"https://api.github.com/users/melinath/following{/other_user}","gists_url":"https://api.github.com/users/melinath/gists{/gist_id}","starred_url":"https://api.github.com/users/melinath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melinath/subscriptions","organizations_url":"https://api.github.com/users/melinath/orgs","repos_url":"https://api.github.com/users/melinath/repos","events_url":"https://api.github.com/users/melinath/events{/privacy}","received_events_url":"https://api.github.com/users/melinath/received_events","type":"User","site_admin":false},"body":"will do","created_at":"2015-10-29T17:23:32Z","updated_at":"2015-10-29T17:23:32Z","html_url":"https://github.com/littleweaver/django-brambling/pull/687#discussion_r43416454","pull_request_url":"https://api.github.com/repos/littleweaver/django-brambling/pulls/687","_links":{"self":{"href":"https://api.github.com/repos/littleweaver/django-brambling/pulls/comments/43416454"},"html":{"href":"https://github.com/littleweaver/django-brambling/pull/687#discussion_r43416454"},"pull_request":{"href":"https://api.github.com/repos/littleweaver/django-brambling/pulls/687"}}},"pull_request":{"url":"https://api.github.com/repos/littleweaver/django-brambling/pulls/687","id":48921836,"html_url":"https://github.com/littleweaver/django-brambling/pull/687","diff_url":"https://github.com/littleweaver/django-brambling/pull/687.diff","patch_url":"https://github.com/littleweaver/django-brambling/pull/687.patch","issue_url":"https://api.github.com/repos/littleweaver/django-brambling/issues/687","number":687,"state":"closed","locked":false,"title":"Can refund fix","user":{"login":"melinath","id":299979,"avatar_url":"https://avatars.githubusercontent.com/u/299979?v=3","gravatar_id":"","url":"https://api.github.com/users/melinath","html_url":"https://github.com/melinath","followers_url":"https://api.github.com/users/melinath/followers","following_url":"https://api.github.com/users/melinath/following{/other_user}","gists_url":"https://api.github.com/users/melinath/gists{/gist_id}","starred_url":"https://api.github.com/users/melinath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melinath/subscriptions","organizations_url":"https://api.github.com/users/melinath/orgs","repos_url":"https://api.github.com/users/melinath/repos","events_url":"https://api.github.com/users/melinath/events{/privacy}","received_events_url":"https://api.github.com/users/melinath/received_events","type":"User","site_admin":false},"body":"Resolved #686 plus a bit. Basically, corrected Transaction refund-related behavior when Transaction's amount is 0 (for example, a fully-comped item). Includes new tests, oh boy!","created_at":"2015-10-27T19:41:58Z","updated_at":"2015-10-29T17:23:32Z","closed_at":"2015-10-29T17:16:16Z","merged_at":"2015-10-29T17:16:16Z","merge_commit_sha":"ba11971dd783d4afb5661ba68b015471c39bd780","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/littleweaver/django-brambling/pulls/687/commits","review_comments_url":"https://api.github.com/repos/littleweaver/django-brambling/pulls/687/comments","review_comment_url":"https://api.github.com/repos/littleweaver/django-brambling/pulls/comments{/number}","comments_url":"https://api.github.com/repos/littleweaver/django-brambling/issues/687/comments","statuses_url":"https://api.github.com/repos/littleweaver/django-brambling/statuses/611d6b02e8c3694ace2090ce11ac898d5678f316","head":{"label":"littleweaver:can-refund-fix","ref":"can-refund-fix","sha":"611d6b02e8c3694ace2090ce11ac898d5678f316","user":{"login":"littleweaver","id":6463669,"avatar_url":"https://avatars.githubusercontent.com/u/6463669?v=3","gravatar_id":"","url":"https://api.github.com/users/littleweaver","html_url":"https://github.com/littleweaver","followers_url":"https://api.github.com/users/littleweaver/followers","following_url":"https://api.github.com/users/littleweaver/following{/other_user}","gists_url":"https://api.github.com/users/littleweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/littleweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littleweaver/subscriptions","organizations_url":"https://api.github.com/users/littleweaver/orgs","repos_url":"https://api.github.com/users/littleweaver/repos","events_url":"https://api.github.com/users/littleweaver/events{/privacy}","received_events_url":"https://api.github.com/users/littleweaver/received_events","type":"Organization","site_admin":false},"repo":{"id":16976982,"name":"django-brambling","full_name":"littleweaver/django-brambling","owner":{"login":"littleweaver","id":6463669,"avatar_url":"https://avatars.githubusercontent.com/u/6463669?v=3","gravatar_id":"","url":"https://api.github.com/users/littleweaver","html_url":"https://github.com/littleweaver","followers_url":"https://api.github.com/users/littleweaver/followers","following_url":"https://api.github.com/users/littleweaver/following{/other_user}","gists_url":"https://api.github.com/users/littleweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/littleweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littleweaver/subscriptions","organizations_url":"https://api.github.com/users/littleweaver/orgs","repos_url":"https://api.github.com/users/littleweaver/repos","events_url":"https://api.github.com/users/littleweaver/events{/privacy}","received_events_url":"https://api.github.com/users/littleweaver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/littleweaver/django-brambling","description":"Event website manager, specifically designed for dance weekends or other events with multiple simultaneous tracks of classes.","fork":false,"url":"https://api.github.com/repos/littleweaver/django-brambling","forks_url":"https://api.github.com/repos/littleweaver/django-brambling/forks","keys_url":"https://api.github.com/repos/littleweaver/django-brambling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/littleweaver/django-brambling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/littleweaver/django-brambling/teams","hooks_url":"https://api.github.com/repos/littleweaver/django-brambling/hooks","issue_events_url":"https://api.github.com/repos/littleweaver/django-brambling/issues/events{/number}","events_url":"https://api.github.com/repos/littleweaver/django-brambling/events","assignees_url":"https://api.github.com/repos/littleweaver/django-brambling/assignees{/user}","branches_url":"https://api.github.com/repos/littleweaver/django-brambling/branches{/branch}","tags_url":"https://api.github.com/repos/littleweaver/django-brambling/tags","blobs_url":"https://api.github.com/repos/littleweaver/django-brambling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/littleweaver/django-brambling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/littleweaver/django-brambling/git/refs{/sha}","trees_url":"https://api.github.com/repos/littleweaver/django-brambling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/littleweaver/django-brambling/statuses/{sha}","languages_url":"https://api.github.com/repos/littleweaver/django-brambling/languages","stargazers_url":"https://api.github.com/repos/littleweaver/django-brambling/stargazers","contributors_url":"https://api.github.com/repos/littleweaver/django-brambling/contributors","subscribers_url":"https://api.github.com/repos/littleweaver/django-brambling/subscribers","subscription_url":"https://api.github.com/repos/littleweaver/django-brambling/subscription","commits_url":"https://api.github.com/repos/littleweaver/django-brambling/commits{/sha}","git_commits_url":"https://api.github.com/repos/littleweaver/django-brambling/git/commits{/sha}","comments_url":"https://api.github.com/repos/littleweaver/django-brambling/comments{/number}","issue_comment_url":"https://api.github.com/repos/littleweaver/django-brambling/issues/comments{/number}","contents_url":"https://api.github.com/repos/littleweaver/django-brambling/contents/{+path}","compare_url":"https://api.github.com/repos/littleweaver/django-brambling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/littleweaver/django-brambling/merges","archive_url":"https://api.github.com/repos/littleweaver/django-brambling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/littleweaver/django-brambling/downloads","issues_url":"https://api.github.com/repos/littleweaver/django-brambling/issues{/number}","pulls_url":"https://api.github.com/repos/littleweaver/django-brambling/pulls{/number}","milestones_url":"https://api.github.com/repos/littleweaver/django-brambling/milestones{/number}","notifications_url":"https://api.github.com/repos/littleweaver/django-brambling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/littleweaver/django-brambling/labels{/name}","releases_url":"https://api.github.com/repos/littleweaver/django-brambling/releases{/id}","created_at":"2014-02-19T07:33:46Z","updated_at":"2015-10-08T05:16:21Z","pushed_at":"2015-10-29T17:20:45Z","git_url":"git://github.com/littleweaver/django-brambling.git","ssh_url":"git@github.com:littleweaver/django-brambling.git","clone_url":"https://github.com/littleweaver/django-brambling.git","svn_url":"https://github.com/littleweaver/django-brambling","homepage":"","size":11049,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":187,"forks":2,"open_issues":187,"watchers":3,"default_branch":"master"}},"base":{"label":"littleweaver:master","ref":"master","sha":"3272707ba06ae0557b73e37d7028ceef368bb818","user":{"login":"littleweaver","id":6463669,"avatar_url":"https://avatars.githubusercontent.com/u/6463669?v=3","gravatar_id":"","url":"https://api.github.com/users/littleweaver","html_url":"https://github.com/littleweaver","followers_url":"https://api.github.com/users/littleweaver/followers","following_url":"https://api.github.com/users/littleweaver/following{/other_user}","gists_url":"https://api.github.com/users/littleweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/littleweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littleweaver/subscriptions","organizations_url":"https://api.github.com/users/littleweaver/orgs","repos_url":"https://api.github.com/users/littleweaver/repos","events_url":"https://api.github.com/users/littleweaver/events{/privacy}","received_events_url":"https://api.github.com/users/littleweaver/received_events","type":"Organization","site_admin":false},"repo":{"id":16976982,"name":"django-brambling","full_name":"littleweaver/django-brambling","owner":{"login":"littleweaver","id":6463669,"avatar_url":"https://avatars.githubusercontent.com/u/6463669?v=3","gravatar_id":"","url":"https://api.github.com/users/littleweaver","html_url":"https://github.com/littleweaver","followers_url":"https://api.github.com/users/littleweaver/followers","following_url":"https://api.github.com/users/littleweaver/following{/other_user}","gists_url":"https://api.github.com/users/littleweaver/gists{/gist_id}","starred_url":"https://api.github.com/users/littleweaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littleweaver/subscriptions","organizations_url":"https://api.github.com/users/littleweaver/orgs","repos_url":"https://api.github.com/users/littleweaver/repos","events_url":"https://api.github.com/users/littleweaver/events{/privacy}","received_events_url":"https://api.github.com/users/littleweaver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/littleweaver/django-brambling","description":"Event website manager, specifically designed for dance weekends or other events with multiple simultaneous tracks of classes.","fork":false,"url":"https://api.github.com/repos/littleweaver/django-brambling","forks_url":"https://api.github.com/repos/littleweaver/django-brambling/forks","keys_url":"https://api.github.com/repos/littleweaver/django-brambling/keys{/key_id}","collaborators_url":"https://api.github.com/repos/littleweaver/django-brambling/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/littleweaver/django-brambling/teams","hooks_url":"https://api.github.com/repos/littleweaver/django-brambling/hooks","issue_events_url":"https://api.github.com/repos/littleweaver/django-brambling/issues/events{/number}","events_url":"https://api.github.com/repos/littleweaver/django-brambling/events","assignees_url":"https://api.github.com/repos/littleweaver/django-brambling/assignees{/user}","branches_url":"https://api.github.com/repos/littleweaver/django-brambling/branches{/branch}","tags_url":"https://api.github.com/repos/littleweaver/django-brambling/tags","blobs_url":"https://api.github.com/repos/littleweaver/django-brambling/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/littleweaver/django-brambling/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/littleweaver/django-brambling/git/refs{/sha}","trees_url":"https://api.github.com/repos/littleweaver/django-brambling/git/trees{/sha}","statuses_url":"https://api.github.com/repos/littleweaver/django-brambling/statuses/{sha}","languages_url":"https://api.github.com/repos/littleweaver/django-brambling/languages","stargazers_url":"https://api.github.com/repos/littleweaver/django-brambling/stargazers","contributors_url":"https://api.github.com/repos/littleweaver/django-brambling/contributors","subscribers_url":"https://api.github.com/repos/littleweaver/django-brambling/subscribers","subscription_url":"https://api.github.com/repos/littleweaver/django-brambling/subscription","commits_url":"https://api.github.com/repos/littleweaver/django-brambling/commits{/sha}","git_commits_url":"https://api.github.com/repos/littleweaver/django-brambling/git/commits{/sha}","comments_url":"https://api.github.com/repos/littleweaver/django-brambling/comments{/number}","issue_comment_url":"https://api.github.com/repos/littleweaver/django-brambling/issues/comments{/number}","contents_url":"https://api.github.com/repos/littleweaver/django-brambling/contents/{+path}","compare_url":"https://api.github.com/repos/littleweaver/django-brambling/compare/{base}...{head}","merges_url":"https://api.github.com/repos/littleweaver/django-brambling/merges","archive_url":"https://api.github.com/repos/littleweaver/django-brambling/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/littleweaver/django-brambling/downloads","issues_url":"https://api.github.com/repos/littleweaver/django-brambling/issues{/number}","pulls_url":"https://api.github.com/repos/littleweaver/django-brambling/pulls{/number}","milestones_url":"https://api.github.com/repos/littleweaver/django-brambling/milestones{/number}","notifications_url":"https://api.github.com/repos/littleweaver/django-brambling/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/littleweaver/django-brambling/labels{/name}","releases_url":"https://api.github.com/repos/littleweaver/django-brambling/releases{/id}","created_at":"2014-02-19T07:33:46Z","updated_at":"2015-10-08T05:16:21Z","pushed_at":"2015-10-29T17:20:45Z","git_url":"git://github.com/littleweaver/django-brambling.git","ssh_url":"git@github.com:littleweaver/django-brambling.git","clone_url":"https://github.com/littleweaver/django-brambling.git","svn_url":"https://github.com/littleweaver/django-brambling","homepage":"","size":11049,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":187,"forks":2,"open_issues":187,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/littleweaver/django-brambling/pulls/687"},"html":{"href":"https://github.com/littleweaver/django-brambling/pull/687"},"issue":{"href":"https://api.github.com/repos/littleweaver/django-brambling/issues/687"},"comments":{"href":"https://api.github.com/repos/littleweaver/django-brambling/issues/687/comments"},"review_comments":{"href":"https://api.github.com/repos/littleweaver/django-brambling/pulls/687/comments"},"review_comment":{"href":"https://api.github.com/repos/littleweaver/django-brambling/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/littleweaver/django-brambling/pulls/687/commits"},"statuses":{"href":"https://api.github.com/repos/littleweaver/django-brambling/statuses/611d6b02e8c3694ace2090ce11ac898d5678f316"}}}}