{"action":"created","comment":{"url":"https://api.github.com/repos/mirumee/saleor/pulls/comments/91735738","pull_request_review_id":12247187,"id":91735738,"diff_hunk":"@@ -38,23 +36,78 @@ def __init__(self, *args, **kwargs):\n             queryset=product.variants)\n \n \n+class ProductClassForm(forms.ModelForm):\n+    class Meta:\n+        model = ProductClass\n+        exclude = []\n+\n+    def clean(self):\n+        data = super(ProductClassForm, self).clean()\n+        has_variants = self.cleaned_data['has_variants']\n+        product_attr = set(self.cleaned_data['product_attributes'])\n+        variant_attr = set(self.cleaned_data['variant_attributes'])\n+        if not has_variants and len(variant_attr) > 0:\n+            msg = pgettext_lazy(\n+                \"Product Class Errors\",\n+                \"This class has no variants options selected.\")\n+            self.add_error('variant_attributes', msg)\n+        if len(product_attr & variant_attr) > 0:\n+            msg = pgettext_lazy(\n+                \"Product Class Errors\",\n+                \"Do not use same attributes in both product and variant.\")","path":"saleor/dashboard/product/forms.py","position":53,"original_position":53,"commit_id":"cf8302137a85b137d44f5d608ae51558b26bdc83","original_commit_id":"cf8302137a85b137d44f5d608ae51558b26bdc83","user":{"login":"patrys","id":81205,"avatar_url":"https://avatars.githubusercontent.com/u/81205?v=3","gravatar_id":"","url":"https://api.github.com/users/patrys","html_url":"https://github.com/patrys","followers_url":"https://api.github.com/users/patrys/followers","following_url":"https://api.github.com/users/patrys/following{/other_user}","gists_url":"https://api.github.com/users/patrys/gists{/gist_id}","starred_url":"https://api.github.com/users/patrys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrys/subscriptions","organizations_url":"https://api.github.com/users/patrys/orgs","repos_url":"https://api.github.com/users/patrys/repos","events_url":"https://api.github.com/users/patrys/events{/privacy}","received_events_url":"https://api.github.com/users/patrys/received_events","type":"User","site_admin":false},"body":">A single attribute can't belong to both a product and its variant.","created_at":"2016-12-09T15:28:10Z","updated_at":"2016-12-09T15:28:10Z","html_url":"https://github.com/mirumee/saleor/pull/646#discussion_r91735738","pull_request_url":"https://api.github.com/repos/mirumee/saleor/pulls/646","_links":{"self":{"href":"https://api.github.com/repos/mirumee/saleor/pulls/comments/91735738"},"html":{"href":"https://github.com/mirumee/saleor/pull/646#discussion_r91735738"},"pull_request":{"href":"https://api.github.com/repos/mirumee/saleor/pulls/646"}}},"pull_request":{"url":"https://api.github.com/repos/mirumee/saleor/pulls/646","id":97313678,"html_url":"https://github.com/mirumee/saleor/pull/646","diff_url":"https://github.com/mirumee/saleor/pull/646.diff","patch_url":"https://github.com/mirumee/saleor/pull/646.patch","issue_url":"https://api.github.com/repos/mirumee/saleor/issues/646","number":646,"state":"open","locked":false,"title":"Introduce ProductClass","user":{"login":"krzysztofwolski","id":5188636,"avatar_url":"https://avatars.githubusercontent.com/u/5188636?v=3","gravatar_id":"","url":"https://api.github.com/users/krzysztofwolski","html_url":"https://github.com/krzysztofwolski","followers_url":"https://api.github.com/users/krzysztofwolski/followers","following_url":"https://api.github.com/users/krzysztofwolski/following{/other_user}","gists_url":"https://api.github.com/users/krzysztofwolski/gists{/gist_id}","starred_url":"https://api.github.com/users/krzysztofwolski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzysztofwolski/subscriptions","organizations_url":"https://api.github.com/users/krzysztofwolski/orgs","repos_url":"https://api.github.com/users/krzysztofwolski/repos","events_url":"https://api.github.com/users/krzysztofwolski/events{/privacy}","received_events_url":"https://api.github.com/users/krzysztofwolski/received_events","type":"User","site_admin":false},"body":"Fix #629\r\n\r\nTODO:\r\n\r\n- [ ] Docs about ProductClass\r\n- [ ] Migrations for product\r\n- [ ] Remove old external JSONField from migrations","created_at":"2016-12-09T13:59:39Z","updated_at":"2016-12-09T15:28:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mirumee/saleor/pulls/646/commits","review_comments_url":"https://api.github.com/repos/mirumee/saleor/pulls/646/comments","review_comment_url":"https://api.github.com/repos/mirumee/saleor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mirumee/saleor/issues/646/comments","statuses_url":"https://api.github.com/repos/mirumee/saleor/statuses/cf8302137a85b137d44f5d608ae51558b26bdc83","head":{"label":"krzysztofwolski:feature/product-class","ref":"feature/product-class","sha":"cf8302137a85b137d44f5d608ae51558b26bdc83","user":{"login":"krzysztofwolski","id":5188636,"avatar_url":"https://avatars.githubusercontent.com/u/5188636?v=3","gravatar_id":"","url":"https://api.github.com/users/krzysztofwolski","html_url":"https://github.com/krzysztofwolski","followers_url":"https://api.github.com/users/krzysztofwolski/followers","following_url":"https://api.github.com/users/krzysztofwolski/following{/other_user}","gists_url":"https://api.github.com/users/krzysztofwolski/gists{/gist_id}","starred_url":"https://api.github.com/users/krzysztofwolski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzysztofwolski/subscriptions","organizations_url":"https://api.github.com/users/krzysztofwolski/orgs","repos_url":"https://api.github.com/users/krzysztofwolski/repos","events_url":"https://api.github.com/users/krzysztofwolski/events{/privacy}","received_events_url":"https://api.github.com/users/krzysztofwolski/received_events","type":"User","site_admin":false},"repo":{"id":65192517,"name":"saleor","full_name":"krzysztofwolski/saleor","owner":{"login":"krzysztofwolski","id":5188636,"avatar_url":"https://avatars.githubusercontent.com/u/5188636?v=3","gravatar_id":"","url":"https://api.github.com/users/krzysztofwolski","html_url":"https://github.com/krzysztofwolski","followers_url":"https://api.github.com/users/krzysztofwolski/followers","following_url":"https://api.github.com/users/krzysztofwolski/following{/other_user}","gists_url":"https://api.github.com/users/krzysztofwolski/gists{/gist_id}","starred_url":"https://api.github.com/users/krzysztofwolski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krzysztofwolski/subscriptions","organizations_url":"https://api.github.com/users/krzysztofwolski/orgs","repos_url":"https://api.github.com/users/krzysztofwolski/repos","events_url":"https://api.github.com/users/krzysztofwolski/events{/privacy}","received_events_url":"https://api.github.com/users/krzysztofwolski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krzysztofwolski/saleor","description":"An e-commerce storefront for Python and Django","fork":true,"url":"https://api.github.com/repos/krzysztofwolski/saleor","forks_url":"https://api.github.com/repos/krzysztofwolski/saleor/forks","keys_url":"https://api.github.com/repos/krzysztofwolski/saleor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krzysztofwolski/saleor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krzysztofwolski/saleor/teams","hooks_url":"https://api.github.com/repos/krzysztofwolski/saleor/hooks","issue_events_url":"https://api.github.com/repos/krzysztofwolski/saleor/issues/events{/number}","events_url":"https://api.github.com/repos/krzysztofwolski/saleor/events","assignees_url":"https://api.github.com/repos/krzysztofwolski/saleor/assignees{/user}","branches_url":"https://api.github.com/repos/krzysztofwolski/saleor/branches{/branch}","tags_url":"https://api.github.com/repos/krzysztofwolski/saleor/tags","blobs_url":"https://api.github.com/repos/krzysztofwolski/saleor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krzysztofwolski/saleor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krzysztofwolski/saleor/git/refs{/sha}","trees_url":"https://api.github.com/repos/krzysztofwolski/saleor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krzysztofwolski/saleor/statuses/{sha}","languages_url":"https://api.github.com/repos/krzysztofwolski/saleor/languages","stargazers_url":"https://api.github.com/repos/krzysztofwolski/saleor/stargazers","contributors_url":"https://api.github.com/repos/krzysztofwolski/saleor/contributors","subscribers_url":"https://api.github.com/repos/krzysztofwolski/saleor/subscribers","subscription_url":"https://api.github.com/repos/krzysztofwolski/saleor/subscription","commits_url":"https://api.github.com/repos/krzysztofwolski/saleor/commits{/sha}","git_commits_url":"https://api.github.com/repos/krzysztofwolski/saleor/git/commits{/sha}","comments_url":"https://api.github.com/repos/krzysztofwolski/saleor/comments{/number}","issue_comment_url":"https://api.github.com/repos/krzysztofwolski/saleor/issues/comments{/number}","contents_url":"https://api.github.com/repos/krzysztofwolski/saleor/contents/{+path}","compare_url":"https://api.github.com/repos/krzysztofwolski/saleor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krzysztofwolski/saleor/merges","archive_url":"https://api.github.com/repos/krzysztofwolski/saleor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krzysztofwolski/saleor/downloads","issues_url":"https://api.github.com/repos/krzysztofwolski/saleor/issues{/number}","pulls_url":"https://api.github.com/repos/krzysztofwolski/saleor/pulls{/number}","milestones_url":"https://api.github.com/repos/krzysztofwolski/saleor/milestones{/number}","notifications_url":"https://api.github.com/repos/krzysztofwolski/saleor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krzysztofwolski/saleor/labels{/name}","releases_url":"https://api.github.com/repos/krzysztofwolski/saleor/releases{/id}","deployments_url":"https://api.github.com/repos/krzysztofwolski/saleor/deployments","created_at":"2016-08-08T09:44:24Z","updated_at":"2016-08-08T09:44:26Z","pushed_at":"2016-12-09T14:13:16Z","git_url":"git://github.com/krzysztofwolski/saleor.git","ssh_url":"git@github.com:krzysztofwolski/saleor.git","clone_url":"https://github.com/krzysztofwolski/saleor.git","svn_url":"https://github.com/krzysztofwolski/saleor","homepage":"http://getsaleor.com","size":9969,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"mirumee:master","ref":"master","sha":"1ad67489d8e0a8ad635eea2487588ecf9c16121c","user":{"login":"mirumee","id":170574,"avatar_url":"https://avatars.githubusercontent.com/u/170574?v=3","gravatar_id":"","url":"https://api.github.com/users/mirumee","html_url":"https://github.com/mirumee","followers_url":"https://api.github.com/users/mirumee/followers","following_url":"https://api.github.com/users/mirumee/following{/other_user}","gists_url":"https://api.github.com/users/mirumee/gists{/gist_id}","starred_url":"https://api.github.com/users/mirumee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirumee/subscriptions","organizations_url":"https://api.github.com/users/mirumee/orgs","repos_url":"https://api.github.com/users/mirumee/repos","events_url":"https://api.github.com/users/mirumee/events{/privacy}","received_events_url":"https://api.github.com/users/mirumee/received_events","type":"Organization","site_admin":false},"repo":{"id":8162715,"name":"saleor","full_name":"mirumee/saleor","owner":{"login":"mirumee","id":170574,"avatar_url":"https://avatars.githubusercontent.com/u/170574?v=3","gravatar_id":"","url":"https://api.github.com/users/mirumee","html_url":"https://github.com/mirumee","followers_url":"https://api.github.com/users/mirumee/followers","following_url":"https://api.github.com/users/mirumee/following{/other_user}","gists_url":"https://api.github.com/users/mirumee/gists{/gist_id}","starred_url":"https://api.github.com/users/mirumee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirumee/subscriptions","organizations_url":"https://api.github.com/users/mirumee/orgs","repos_url":"https://api.github.com/users/mirumee/repos","events_url":"https://api.github.com/users/mirumee/events{/privacy}","received_events_url":"https://api.github.com/users/mirumee/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mirumee/saleor","description":"An e-commerce storefront for Python and Django","fork":false,"url":"https://api.github.com/repos/mirumee/saleor","forks_url":"https://api.github.com/repos/mirumee/saleor/forks","keys_url":"https://api.github.com/repos/mirumee/saleor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mirumee/saleor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mirumee/saleor/teams","hooks_url":"https://api.github.com/repos/mirumee/saleor/hooks","issue_events_url":"https://api.github.com/repos/mirumee/saleor/issues/events{/number}","events_url":"https://api.github.com/repos/mirumee/saleor/events","assignees_url":"https://api.github.com/repos/mirumee/saleor/assignees{/user}","branches_url":"https://api.github.com/repos/mirumee/saleor/branches{/branch}","tags_url":"https://api.github.com/repos/mirumee/saleor/tags","blobs_url":"https://api.github.com/repos/mirumee/saleor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mirumee/saleor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mirumee/saleor/git/refs{/sha}","trees_url":"https://api.github.com/repos/mirumee/saleor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mirumee/saleor/statuses/{sha}","languages_url":"https://api.github.com/repos/mirumee/saleor/languages","stargazers_url":"https://api.github.com/repos/mirumee/saleor/stargazers","contributors_url":"https://api.github.com/repos/mirumee/saleor/contributors","subscribers_url":"https://api.github.com/repos/mirumee/saleor/subscribers","subscription_url":"https://api.github.com/repos/mirumee/saleor/subscription","commits_url":"https://api.github.com/repos/mirumee/saleor/commits{/sha}","git_commits_url":"https://api.github.com/repos/mirumee/saleor/git/commits{/sha}","comments_url":"https://api.github.com/repos/mirumee/saleor/comments{/number}","issue_comment_url":"https://api.github.com/repos/mirumee/saleor/issues/comments{/number}","contents_url":"https://api.github.com/repos/mirumee/saleor/contents/{+path}","compare_url":"https://api.github.com/repos/mirumee/saleor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mirumee/saleor/merges","archive_url":"https://api.github.com/repos/mirumee/saleor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mirumee/saleor/downloads","issues_url":"https://api.github.com/repos/mirumee/saleor/issues{/number}","pulls_url":"https://api.github.com/repos/mirumee/saleor/pulls{/number}","milestones_url":"https://api.github.com/repos/mirumee/saleor/milestones{/number}","notifications_url":"https://api.github.com/repos/mirumee/saleor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mirumee/saleor/labels{/name}","releases_url":"https://api.github.com/repos/mirumee/saleor/releases{/id}","deployments_url":"https://api.github.com/repos/mirumee/saleor/deployments","created_at":"2013-02-12T16:46:39Z","updated_at":"2016-12-09T02:59:02Z","pushed_at":"2016-12-09T15:07:24Z","git_url":"git://github.com/mirumee/saleor.git","ssh_url":"git@github.com:mirumee/saleor.git","clone_url":"https://github.com/mirumee/saleor.git","svn_url":"https://github.com/mirumee/saleor","homepage":"http://getsaleor.com","size":16591,"stargazers_count":643,"watchers_count":643,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":262,"mirror_url":null,"open_issues_count":81,"forks":262,"open_issues":81,"watchers":643,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mirumee/saleor/pulls/646"},"html":{"href":"https://github.com/mirumee/saleor/pull/646"},"issue":{"href":"https://api.github.com/repos/mirumee/saleor/issues/646"},"comments":{"href":"https://api.github.com/repos/mirumee/saleor/issues/646/comments"},"review_comments":{"href":"https://api.github.com/repos/mirumee/saleor/pulls/646/comments"},"review_comment":{"href":"https://api.github.com/repos/mirumee/saleor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mirumee/saleor/pulls/646/commits"},"statuses":{"href":"https://api.github.com/repos/mirumee/saleor/statuses/cf8302137a85b137d44f5d608ae51558b26bdc83"}}}}
{"actor":{"display_login":"patrys"}}