{"action":"created","comment":{"url":"https://api.github.com/repos/allegro/ralph/pulls/comments/50371674","id":50371674,"diff_hunk":"@@ -84,3 +75,24 @@ def formset_invalid(self, formset):\n         return self.render_to_response(\n             self.get_context_data(formset=formset)\n         )\n+\n+\n+class ServeAttachment(View):\n+\n+    def get(self, *args, **kwargs):\n+        \"\"\"\n+        All attachments are serving by this view because we need full\n+        control (e.g., permissions, rename).\n+        \"\"\"\n+        # TODO: respect permissions\n+        obj = get_object_or_404(\n+            Attachment,\n+            id=self.kwargs['id'],","path":"src/ralph/attachments/views.py","position":55,"original_position":55,"commit_id":"827173f44f3c9aced85a38d67319cdda202ce9f0","original_commit_id":"827173f44f3c9aced85a38d67319cdda202ce9f0","user":{"login":"mkurek","id":107437,"avatar_url":"https://avatars.githubusercontent.com/u/107437?v=3","gravatar_id":"","url":"https://api.github.com/users/mkurek","html_url":"https://github.com/mkurek","followers_url":"https://api.github.com/users/mkurek/followers","following_url":"https://api.github.com/users/mkurek/following{/other_user}","gists_url":"https://api.github.com/users/mkurek/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurek/subscriptions","organizations_url":"https://api.github.com/users/mkurek/orgs","repos_url":"https://api.github.com/users/mkurek/repos","events_url":"https://api.github.com/users/mkurek/events{/privacy}","received_events_url":"https://api.github.com/users/mkurek/received_events","type":"User","site_admin":false},"body":"why not kwargs['id']? you could use another definition too imo: `def get(self, request, id, filename)`","created_at":"2016-01-21T08:29:39Z","updated_at":"2016-01-21T08:29:39Z","html_url":"https://github.com/allegro/ralph/pull/2156#discussion_r50371674","pull_request_url":"https://api.github.com/repos/allegro/ralph/pulls/2156","_links":{"self":{"href":"https://api.github.com/repos/allegro/ralph/pulls/comments/50371674"},"html":{"href":"https://github.com/allegro/ralph/pull/2156#discussion_r50371674"},"pull_request":{"href":"https://api.github.com/repos/allegro/ralph/pulls/2156"}}},"pull_request":{"url":"https://api.github.com/repos/allegro/ralph/pulls/2156","id":56168503,"html_url":"https://github.com/allegro/ralph/pull/2156","diff_url":"https://github.com/allegro/ralph/pull/2156.diff","patch_url":"https://github.com/allegro/ralph/pull/2156.patch","issue_url":"https://api.github.com/repos/allegro/ralph/issues/2156","number":2156,"state":"open","locked":false,"title":"Dc move to bo transition","user":{"login":"szok","id":2209581,"avatar_url":"https://avatars.githubusercontent.com/u/2209581?v=3","gravatar_id":"","url":"https://api.github.com/users/szok","html_url":"https://github.com/szok","followers_url":"https://api.github.com/users/szok/followers","following_url":"https://api.github.com/users/szok/following{/other_user}","gists_url":"https://api.github.com/users/szok/gists{/gist_id}","starred_url":"https://api.github.com/users/szok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szok/subscriptions","organizations_url":"https://api.github.com/users/szok/orgs","repos_url":"https://api.github.com/users/szok/repos","events_url":"https://api.github.com/users/szok/events{/privacy}","received_events_url":"https://api.github.com/users/szok/received_events","type":"User","site_admin":false},"body":"- [x] Move DC to BO\r\n- [x] Move BO to DC\r\n- [x] Unit tests\r\n\r\nUpdate all attachments:\r\n```\r\nfrom ralph.admin.helpers import get_content_type_for_model\r\nfrom ralph.attachments.models import AttachmentItem\r\n\r\nfor i in AttachmentItem.objects.all():\r\n    i.content_type = get_content_type_for_model(i.content_type.model_class())\r\n    i.save()\r\n```\r\n\r\nUpdate TransitionsHistory\r\n```\r\nfrom ralph.admin.helpers import get_content_type_for_model\r\nfrom ralph.lib.transitions.models import TransitionsHistory\r\n\r\nfor i in TransitionsHistory.objects.all():\r\n    i.content_type = get_content_type_for_model(i.content_type.model_class())\r\n    i.save()\r\n```","created_at":"2016-01-15T13:25:56Z","updated_at":"2016-01-21T08:29:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31c68e9bdd24644647f7fc7bc555237782cfb538","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/allegro/ralph/pulls/2156/commits","review_comments_url":"https://api.github.com/repos/allegro/ralph/pulls/2156/comments","review_comment_url":"https://api.github.com/repos/allegro/ralph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allegro/ralph/issues/2156/comments","statuses_url":"https://api.github.com/repos/allegro/ralph/statuses/827173f44f3c9aced85a38d67319cdda202ce9f0","head":{"label":"szok:dc-move-bo-transition","ref":"dc-move-bo-transition","sha":"827173f44f3c9aced85a38d67319cdda202ce9f0","user":{"login":"szok","id":2209581,"avatar_url":"https://avatars.githubusercontent.com/u/2209581?v=3","gravatar_id":"","url":"https://api.github.com/users/szok","html_url":"https://github.com/szok","followers_url":"https://api.github.com/users/szok/followers","following_url":"https://api.github.com/users/szok/following{/other_user}","gists_url":"https://api.github.com/users/szok/gists{/gist_id}","starred_url":"https://api.github.com/users/szok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szok/subscriptions","organizations_url":"https://api.github.com/users/szok/orgs","repos_url":"https://api.github.com/users/szok/repos","events_url":"https://api.github.com/users/szok/events{/privacy}","received_events_url":"https://api.github.com/users/szok/received_events","type":"User","site_admin":false},"repo":{"id":32583868,"name":"ralph","full_name":"szok/ralph","owner":{"login":"szok","id":2209581,"avatar_url":"https://avatars.githubusercontent.com/u/2209581?v=3","gravatar_id":"","url":"https://api.github.com/users/szok","html_url":"https://github.com/szok","followers_url":"https://api.github.com/users/szok/followers","following_url":"https://api.github.com/users/szok/following{/other_user}","gists_url":"https://api.github.com/users/szok/gists{/gist_id}","starred_url":"https://api.github.com/users/szok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szok/subscriptions","organizations_url":"https://api.github.com/users/szok/orgs","repos_url":"https://api.github.com/users/szok/repos","events_url":"https://api.github.com/users/szok/events{/privacy}","received_events_url":"https://api.github.com/users/szok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/szok/ralph","description":"Ralph is an asset management system for your data center.","fork":true,"url":"https://api.github.com/repos/szok/ralph","forks_url":"https://api.github.com/repos/szok/ralph/forks","keys_url":"https://api.github.com/repos/szok/ralph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/szok/ralph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/szok/ralph/teams","hooks_url":"https://api.github.com/repos/szok/ralph/hooks","issue_events_url":"https://api.github.com/repos/szok/ralph/issues/events{/number}","events_url":"https://api.github.com/repos/szok/ralph/events","assignees_url":"https://api.github.com/repos/szok/ralph/assignees{/user}","branches_url":"https://api.github.com/repos/szok/ralph/branches{/branch}","tags_url":"https://api.github.com/repos/szok/ralph/tags","blobs_url":"https://api.github.com/repos/szok/ralph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/szok/ralph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/szok/ralph/git/refs{/sha}","trees_url":"https://api.github.com/repos/szok/ralph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/szok/ralph/statuses/{sha}","languages_url":"https://api.github.com/repos/szok/ralph/languages","stargazers_url":"https://api.github.com/repos/szok/ralph/stargazers","contributors_url":"https://api.github.com/repos/szok/ralph/contributors","subscribers_url":"https://api.github.com/repos/szok/ralph/subscribers","subscription_url":"https://api.github.com/repos/szok/ralph/subscription","commits_url":"https://api.github.com/repos/szok/ralph/commits{/sha}","git_commits_url":"https://api.github.com/repos/szok/ralph/git/commits{/sha}","comments_url":"https://api.github.com/repos/szok/ralph/comments{/number}","issue_comment_url":"https://api.github.com/repos/szok/ralph/issues/comments{/number}","contents_url":"https://api.github.com/repos/szok/ralph/contents/{+path}","compare_url":"https://api.github.com/repos/szok/ralph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/szok/ralph/merges","archive_url":"https://api.github.com/repos/szok/ralph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/szok/ralph/downloads","issues_url":"https://api.github.com/repos/szok/ralph/issues{/number}","pulls_url":"https://api.github.com/repos/szok/ralph/pulls{/number}","milestones_url":"https://api.github.com/repos/szok/ralph/milestones{/number}","notifications_url":"https://api.github.com/repos/szok/ralph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/szok/ralph/labels{/name}","releases_url":"https://api.github.com/repos/szok/ralph/releases{/id}","created_at":"2015-03-20T13:01:10Z","updated_at":"2015-09-18T11:19:23Z","pushed_at":"2016-01-21T07:48:40Z","git_url":"git://github.com/szok/ralph.git","ssh_url":"git@github.com:szok/ralph.git","clone_url":"https://github.com/szok/ralph.git","svn_url":"https://github.com/szok/ralph","homepage":"http://ralph.allegrogroup.com/","size":21534,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"develop"}},"base":{"label":"allegro:ng","ref":"ng","sha":"3fc46260723a26358069280d19c09e6829c090f4","user":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"repo":{"id":4359038,"name":"ralph","full_name":"allegro/ralph","owner":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allegro/ralph","description":"Ralph is an asset management system for your data center.","fork":false,"url":"https://api.github.com/repos/allegro/ralph","forks_url":"https://api.github.com/repos/allegro/ralph/forks","keys_url":"https://api.github.com/repos/allegro/ralph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allegro/ralph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allegro/ralph/teams","hooks_url":"https://api.github.com/repos/allegro/ralph/hooks","issue_events_url":"https://api.github.com/repos/allegro/ralph/issues/events{/number}","events_url":"https://api.github.com/repos/allegro/ralph/events","assignees_url":"https://api.github.com/repos/allegro/ralph/assignees{/user}","branches_url":"https://api.github.com/repos/allegro/ralph/branches{/branch}","tags_url":"https://api.github.com/repos/allegro/ralph/tags","blobs_url":"https://api.github.com/repos/allegro/ralph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allegro/ralph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allegro/ralph/git/refs{/sha}","trees_url":"https://api.github.com/repos/allegro/ralph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allegro/ralph/statuses/{sha}","languages_url":"https://api.github.com/repos/allegro/ralph/languages","stargazers_url":"https://api.github.com/repos/allegro/ralph/stargazers","contributors_url":"https://api.github.com/repos/allegro/ralph/contributors","subscribers_url":"https://api.github.com/repos/allegro/ralph/subscribers","subscription_url":"https://api.github.com/repos/allegro/ralph/subscription","commits_url":"https://api.github.com/repos/allegro/ralph/commits{/sha}","git_commits_url":"https://api.github.com/repos/allegro/ralph/git/commits{/sha}","comments_url":"https://api.github.com/repos/allegro/ralph/comments{/number}","issue_comment_url":"https://api.github.com/repos/allegro/ralph/issues/comments{/number}","contents_url":"https://api.github.com/repos/allegro/ralph/contents/{+path}","compare_url":"https://api.github.com/repos/allegro/ralph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allegro/ralph/merges","archive_url":"https://api.github.com/repos/allegro/ralph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allegro/ralph/downloads","issues_url":"https://api.github.com/repos/allegro/ralph/issues{/number}","pulls_url":"https://api.github.com/repos/allegro/ralph/pulls{/number}","milestones_url":"https://api.github.com/repos/allegro/ralph/milestones{/number}","notifications_url":"https://api.github.com/repos/allegro/ralph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allegro/ralph/labels{/name}","releases_url":"https://api.github.com/repos/allegro/ralph/releases{/id}","created_at":"2012-05-17T14:04:57Z","updated_at":"2016-01-21T04:27:14Z","pushed_at":"2016-01-21T07:49:22Z","git_url":"git://github.com/allegro/ralph.git","ssh_url":"git@github.com:allegro/ralph.git","clone_url":"https://github.com/allegro/ralph.git","svn_url":"https://github.com/allegro/ralph","homepage":"http://allegro.tech/ralph/","size":23436,"stargazers_count":354,"watchers_count":354,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":88,"mirror_url":null,"open_issues_count":73,"forks":88,"open_issues":73,"watchers":354,"default_branch":"ng"}},"_links":{"self":{"href":"https://api.github.com/repos/allegro/ralph/pulls/2156"},"html":{"href":"https://github.com/allegro/ralph/pull/2156"},"issue":{"href":"https://api.github.com/repos/allegro/ralph/issues/2156"},"comments":{"href":"https://api.github.com/repos/allegro/ralph/issues/2156/comments"},"review_comments":{"href":"https://api.github.com/repos/allegro/ralph/pulls/2156/comments"},"review_comment":{"href":"https://api.github.com/repos/allegro/ralph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allegro/ralph/pulls/2156/commits"},"statuses":{"href":"https://api.github.com/repos/allegro/ralph/statuses/827173f44f3c9aced85a38d67319cdda202ce9f0"}}}}