{"action":"created","comment":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/comments/22519944","id":22519944,"diff_hunk":"@@ -227,7 +236,53 @@ def manipulate_object(self, form):\n         self.object.reset_state(workflow)\n         self.version = self.object.get_new_version()\n \n-motion_create = MotionCreateView.as_view()\n+\n+class MotionCreateAmendmentView(MotionCreateView):\n+    \"\"\"\n+    Create an amendment.\n+    \"\"\"\n+\n+    def dispatch(self, *args, **kwargs):\n+        if not config['motion_amendments_enabled']:\n+            raise Http404('Amendments are disabled in the config.')\n+        return super(MotionCreateAmendmentView, self).dispatch(*args, **kwargs)\n+\n+    def get_parent_motion(self):\n+        \"\"\"\n+        Gets the parent motion from the url.\n+\n+        Caches the value.\n+        \"\"\"\n+        try:\n+            parent = self._object_parent\n+        except AttributeError:\n+            # self.get_object() is the django method, which does not cache the\n+            # object. For now this is not a problem, because get_object() is only\n+            # called once.\n+            parent = self._object_parent = self.get_object()\n+        return parent\n+\n+    def manipulate_object(self, form):\n+        \"\"\"\n+        Sets the parent to the motion to which this amendment refers.\n+        \"\"\"\n+        self.object.parent = self.get_parent_motion()\n+        super(MotionCreateAmendmentView, self).manipulate_object(form)\n+\n+    def get_initial(self):\n+        \"\"\"\n+        Sets the initial values to the form.\n+\n+        This are the values for title, text and reason which are set to the\n+        values from the parent motion.\n+        \"\"\"\n+        initial = super(MotionCreateAmendmentView, self).get_initial()","path":"openslides/motion/views.py","position":102,"original_position":102,"commit_id":"3f8749b1728917db03b27d9d8070a03a8ddc8184","original_commit_id":"3f8749b1728917db03b27d9d8070a03a8ddc8184","user":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-01-06T12:02:15Z","updated_at":"2015-01-06T12:02:15Z","html_url":"https://github.com/OpenSlides/OpenSlides/pull/1390#discussion_r22519944","pull_request_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1390","_links":{"self":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/comments/22519944"},"html":{"href":"https://github.com/OpenSlides/OpenSlides/pull/1390#discussion_r22519944"},"pull_request":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1390"}}},"pull_request":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1390","id":26833327,"html_url":"https://github.com/OpenSlides/OpenSlides/pull/1390","diff_url":"https://github.com/OpenSlides/OpenSlides/pull/1390.diff","patch_url":"https://github.com/OpenSlides/OpenSlides/pull/1390.patch","issue_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/1390","number":1390,"state":"open","locked":false,"title":"merge of the stable branch into master","user":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"body":"Pull request to show differences. To not merge.","created_at":"2015-01-05T16:20:35Z","updated_at":"2015-01-06T12:02:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ffaa4aae05757dc31e65f42900f676efdcf49b4","assignee":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/milestones/17","labels_url":"https://api.github.com/repos/OpenSlides/OpenSlides/milestones/17/labels","id":720870,"number":17,"title":"2.0","description":"We think we are ready not before March 2015.","creator":{"login":"normanjaeckel","id":2073844,"avatar_url":"https://avatars.githubusercontent.com/u/2073844?v=3","gravatar_id":"","url":"https://api.github.com/users/normanjaeckel","html_url":"https://github.com/normanjaeckel","followers_url":"https://api.github.com/users/normanjaeckel/followers","following_url":"https://api.github.com/users/normanjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/normanjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/normanjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanjaeckel/subscriptions","organizations_url":"https://api.github.com/users/normanjaeckel/orgs","repos_url":"https://api.github.com/users/normanjaeckel/repos","events_url":"https://api.github.com/users/normanjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/normanjaeckel/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":15,"state":"open","created_at":"2014-07-14T20:36:14Z","updated_at":"2015-01-06T11:24:47Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1390/commits","review_comments_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1390/comments","review_comment_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/1390/comments","statuses_url":"https://api.github.com/repos/OpenSlides/OpenSlides/statuses/3f8749b1728917db03b27d9d8070a03a8ddc8184","head":{"label":"ostcar:master","ref":"master","sha":"3f8749b1728917db03b27d9d8070a03a8ddc8184","user":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"repo":{"id":5257807,"name":"OpenSlides","full_name":"ostcar/OpenSlides","owner":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ostcar/OpenSlides","description":"","fork":true,"url":"https://api.github.com/repos/ostcar/OpenSlides","forks_url":"https://api.github.com/repos/ostcar/OpenSlides/forks","keys_url":"https://api.github.com/repos/ostcar/OpenSlides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ostcar/OpenSlides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ostcar/OpenSlides/teams","hooks_url":"https://api.github.com/repos/ostcar/OpenSlides/hooks","issue_events_url":"https://api.github.com/repos/ostcar/OpenSlides/issues/events{/number}","events_url":"https://api.github.com/repos/ostcar/OpenSlides/events","assignees_url":"https://api.github.com/repos/ostcar/OpenSlides/assignees{/user}","branches_url":"https://api.github.com/repos/ostcar/OpenSlides/branches{/branch}","tags_url":"https://api.github.com/repos/ostcar/OpenSlides/tags","blobs_url":"https://api.github.com/repos/ostcar/OpenSlides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ostcar/OpenSlides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ostcar/OpenSlides/git/refs{/sha}","trees_url":"https://api.github.com/repos/ostcar/OpenSlides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ostcar/OpenSlides/statuses/{sha}","languages_url":"https://api.github.com/repos/ostcar/OpenSlides/languages","stargazers_url":"https://api.github.com/repos/ostcar/OpenSlides/stargazers","contributors_url":"https://api.github.com/repos/ostcar/OpenSlides/contributors","subscribers_url":"https://api.github.com/repos/ostcar/OpenSlides/subscribers","subscription_url":"https://api.github.com/repos/ostcar/OpenSlides/subscription","commits_url":"https://api.github.com/repos/ostcar/OpenSlides/commits{/sha}","git_commits_url":"https://api.github.com/repos/ostcar/OpenSlides/git/commits{/sha}","comments_url":"https://api.github.com/repos/ostcar/OpenSlides/comments{/number}","issue_comment_url":"https://api.github.com/repos/ostcar/OpenSlides/issues/comments/{number}","contents_url":"https://api.github.com/repos/ostcar/OpenSlides/contents/{+path}","compare_url":"https://api.github.com/repos/ostcar/OpenSlides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ostcar/OpenSlides/merges","archive_url":"https://api.github.com/repos/ostcar/OpenSlides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ostcar/OpenSlides/downloads","issues_url":"https://api.github.com/repos/ostcar/OpenSlides/issues{/number}","pulls_url":"https://api.github.com/repos/ostcar/OpenSlides/pulls{/number}","milestones_url":"https://api.github.com/repos/ostcar/OpenSlides/milestones{/number}","notifications_url":"https://api.github.com/repos/ostcar/OpenSlides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ostcar/OpenSlides/labels{/name}","releases_url":"https://api.github.com/repos/ostcar/OpenSlides/releases{/id}","created_at":"2012-08-01T10:15:17Z","updated_at":"2015-01-05T16:14:39Z","pushed_at":"2015-01-05T16:14:39Z","git_url":"git://github.com/ostcar/OpenSlides.git","ssh_url":"git@github.com:ostcar/OpenSlides.git","clone_url":"https://github.com/ostcar/OpenSlides.git","svn_url":"https://github.com/ostcar/OpenSlides","homepage":null,"size":35883,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenSlides:master","ref":"master","sha":"dcd8b7a639ae5d01a0b259b128ce9544340081e1","user":{"login":"OpenSlides","id":2055730,"avatar_url":"https://avatars.githubusercontent.com/u/2055730?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSlides","html_url":"https://github.com/OpenSlides","followers_url":"https://api.github.com/users/OpenSlides/followers","following_url":"https://api.github.com/users/OpenSlides/following{/other_user}","gists_url":"https://api.github.com/users/OpenSlides/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSlides/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSlides/subscriptions","organizations_url":"https://api.github.com/users/OpenSlides/orgs","repos_url":"https://api.github.com/users/OpenSlides/repos","events_url":"https://api.github.com/users/OpenSlides/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSlides/received_events","type":"Organization","site_admin":false},"repo":{"id":5250779,"name":"OpenSlides","full_name":"OpenSlides/OpenSlides","owner":{"login":"OpenSlides","id":2055730,"avatar_url":"https://avatars.githubusercontent.com/u/2055730?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSlides","html_url":"https://github.com/OpenSlides","followers_url":"https://api.github.com/users/OpenSlides/followers","following_url":"https://api.github.com/users/OpenSlides/following{/other_user}","gists_url":"https://api.github.com/users/OpenSlides/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSlides/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSlides/subscriptions","organizations_url":"https://api.github.com/users/OpenSlides/orgs","repos_url":"https://api.github.com/users/OpenSlides/repos","events_url":"https://api.github.com/users/OpenSlides/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSlides/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenSlides/OpenSlides","description":"Presentation and assembly system","fork":false,"url":"https://api.github.com/repos/OpenSlides/OpenSlides","forks_url":"https://api.github.com/repos/OpenSlides/OpenSlides/forks","keys_url":"https://api.github.com/repos/OpenSlides/OpenSlides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenSlides/OpenSlides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenSlides/OpenSlides/teams","hooks_url":"https://api.github.com/repos/OpenSlides/OpenSlides/hooks","issue_events_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/events{/number}","events_url":"https://api.github.com/repos/OpenSlides/OpenSlides/events","assignees_url":"https://api.github.com/repos/OpenSlides/OpenSlides/assignees{/user}","branches_url":"https://api.github.com/repos/OpenSlides/OpenSlides/branches{/branch}","tags_url":"https://api.github.com/repos/OpenSlides/OpenSlides/tags","blobs_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenSlides/OpenSlides/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenSlides/OpenSlides/languages","stargazers_url":"https://api.github.com/repos/OpenSlides/OpenSlides/stargazers","contributors_url":"https://api.github.com/repos/OpenSlides/OpenSlides/contributors","subscribers_url":"https://api.github.com/repos/OpenSlides/OpenSlides/subscribers","subscription_url":"https://api.github.com/repos/OpenSlides/OpenSlides/subscription","commits_url":"https://api.github.com/repos/OpenSlides/OpenSlides/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenSlides/OpenSlides/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenSlides/OpenSlides/contents/{+path}","compare_url":"https://api.github.com/repos/OpenSlides/OpenSlides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenSlides/OpenSlides/merges","archive_url":"https://api.github.com/repos/OpenSlides/OpenSlides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenSlides/OpenSlides/downloads","issues_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues{/number}","pulls_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenSlides/OpenSlides/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenSlides/OpenSlides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenSlides/OpenSlides/labels{/name}","releases_url":"https://api.github.com/repos/OpenSlides/OpenSlides/releases{/id}","created_at":"2012-07-31T20:04:39Z","updated_at":"2015-01-03T12:47:44Z","pushed_at":"2015-01-05T16:30:10Z","git_url":"git://github.com/OpenSlides/OpenSlides.git","ssh_url":"git@github.com:OpenSlides/OpenSlides.git","clone_url":"https://github.com/OpenSlides/OpenSlides.git","svn_url":"https://github.com/OpenSlides/OpenSlides","homepage":"http://openslides.org","size":36911,"stargazers_count":53,"watchers_count":53,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":104,"forks":25,"open_issues":104,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1390"},"html":{"href":"https://github.com/OpenSlides/OpenSlides/pull/1390"},"issue":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/1390"},"comments":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/1390/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1390/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1390/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/statuses/3f8749b1728917db03b27d9d8070a03a8ddc8184"}}}}