{"action":"created","comment":{"url":"https://api.github.com/repos/meshy/django-conman/pulls/comments/36578244","id":36578244,"diff_hunk":"@@ -116,6 +117,18 @@ def reset_originals(self):\n         self._original_parent_id = self.parent_id\n         self._original_slug = self.slug\n \n+    def clean(self):\n+        \"\"\"Ensure only one Root Route can exist.\"\"\"\n+        is_root = self.parent_id is None\n+        if is_root:\n+            try:\n+                root = Route.objects.get(parent=None)\n+            except Route.DoesNotExist:\n+                pass\n+            else:\n+                if root != self:\n+                    raise ValidationError('Only one Route can exist.')","path":"conman/routes/models.py","position":20,"original_position":20,"commit_id":"4e65adb0875b2fce224b54615672040a9f9a8c02","original_commit_id":"4e65adb0875b2fce224b54615672040a9f9a8c02","user":{"login":"Ian-Foote","id":1843202,"avatar_url":"https://avatars.githubusercontent.com/u/1843202?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Foote","html_url":"https://github.com/Ian-Foote","followers_url":"https://api.github.com/users/Ian-Foote/followers","following_url":"https://api.github.com/users/Ian-Foote/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Foote/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Foote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Foote/subscriptions","organizations_url":"https://api.github.com/users/Ian-Foote/orgs","repos_url":"https://api.github.com/users/Ian-Foote/repos","events_url":"https://api.github.com/users/Ian-Foote/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Foote/received_events","type":"User","site_admin":false},"body":"I don't like this, but I haven't thought of a cleaner version.","created_at":"2015-08-08T13:31:21Z","updated_at":"2015-08-08T13:31:21Z","html_url":"https://github.com/meshy/django-conman/pull/69#discussion_r36578244","pull_request_url":"https://api.github.com/repos/meshy/django-conman/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/meshy/django-conman/pulls/comments/36578244"},"html":{"href":"https://github.com/meshy/django-conman/pull/69#discussion_r36578244"},"pull_request":{"href":"https://api.github.com/repos/meshy/django-conman/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/meshy/django-conman/pulls/69","id":41954180,"html_url":"https://github.com/meshy/django-conman/pull/69","diff_url":"https://github.com/meshy/django-conman/pull/69.diff","patch_url":"https://github.com/meshy/django-conman/pull/69.patch","issue_url":"https://api.github.com/repos/meshy/django-conman/issues/69","number":69,"state":"open","locked":false,"title":"Forbid creating a second Root Route","user":{"login":"Ian-Foote","id":1843202,"avatar_url":"https://avatars.githubusercontent.com/u/1843202?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Foote","html_url":"https://github.com/Ian-Foote","followers_url":"https://api.github.com/users/Ian-Foote/followers","following_url":"https://api.github.com/users/Ian-Foote/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Foote/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Foote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Foote/subscriptions","organizations_url":"https://api.github.com/users/Ian-Foote/orgs","repos_url":"https://api.github.com/users/Ian-Foote/repos","events_url":"https://api.github.com/users/Ian-Foote/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Foote/received_events","type":"User","site_admin":false},"body":"Fix #61.","created_at":"2015-08-08T13:30:51Z","updated_at":"2015-08-08T13:31:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cce7a4b8212c24cccc90b5c528d86c91dc2f15b","assignee":{"login":"Ian-Foote","id":1843202,"avatar_url":"https://avatars.githubusercontent.com/u/1843202?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Foote","html_url":"https://github.com/Ian-Foote","followers_url":"https://api.github.com/users/Ian-Foote/followers","following_url":"https://api.github.com/users/Ian-Foote/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Foote/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Foote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Foote/subscriptions","organizations_url":"https://api.github.com/users/Ian-Foote/orgs","repos_url":"https://api.github.com/users/Ian-Foote/repos","events_url":"https://api.github.com/users/Ian-Foote/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Foote/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/meshy/django-conman/pulls/69/commits","review_comments_url":"https://api.github.com/repos/meshy/django-conman/pulls/69/comments","review_comment_url":"https://api.github.com/repos/meshy/django-conman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/meshy/django-conman/issues/69/comments","statuses_url":"https://api.github.com/repos/meshy/django-conman/statuses/4e65adb0875b2fce224b54615672040a9f9a8c02","head":{"label":"Ian-Foote:duplicate-root","ref":"duplicate-root","sha":"4e65adb0875b2fce224b54615672040a9f9a8c02","user":{"login":"Ian-Foote","id":1843202,"avatar_url":"https://avatars.githubusercontent.com/u/1843202?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Foote","html_url":"https://github.com/Ian-Foote","followers_url":"https://api.github.com/users/Ian-Foote/followers","following_url":"https://api.github.com/users/Ian-Foote/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Foote/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Foote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Foote/subscriptions","organizations_url":"https://api.github.com/users/Ian-Foote/orgs","repos_url":"https://api.github.com/users/Ian-Foote/repos","events_url":"https://api.github.com/users/Ian-Foote/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Foote/received_events","type":"User","site_admin":false},"repo":{"id":24910487,"name":"django-conman","full_name":"Ian-Foote/django-conman","owner":{"login":"Ian-Foote","id":1843202,"avatar_url":"https://avatars.githubusercontent.com/u/1843202?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Foote","html_url":"https://github.com/Ian-Foote","followers_url":"https://api.github.com/users/Ian-Foote/followers","following_url":"https://api.github.com/users/Ian-Foote/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Foote/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Foote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Foote/subscriptions","organizations_url":"https://api.github.com/users/Ian-Foote/orgs","repos_url":"https://api.github.com/users/Ian-Foote/repos","events_url":"https://api.github.com/users/Ian-Foote/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Foote/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ian-Foote/django-conman","description":"A content management system for django","fork":true,"url":"https://api.github.com/repos/Ian-Foote/django-conman","forks_url":"https://api.github.com/repos/Ian-Foote/django-conman/forks","keys_url":"https://api.github.com/repos/Ian-Foote/django-conman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ian-Foote/django-conman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ian-Foote/django-conman/teams","hooks_url":"https://api.github.com/repos/Ian-Foote/django-conman/hooks","issue_events_url":"https://api.github.com/repos/Ian-Foote/django-conman/issues/events{/number}","events_url":"https://api.github.com/repos/Ian-Foote/django-conman/events","assignees_url":"https://api.github.com/repos/Ian-Foote/django-conman/assignees{/user}","branches_url":"https://api.github.com/repos/Ian-Foote/django-conman/branches{/branch}","tags_url":"https://api.github.com/repos/Ian-Foote/django-conman/tags","blobs_url":"https://api.github.com/repos/Ian-Foote/django-conman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ian-Foote/django-conman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ian-Foote/django-conman/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ian-Foote/django-conman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ian-Foote/django-conman/statuses/{sha}","languages_url":"https://api.github.com/repos/Ian-Foote/django-conman/languages","stargazers_url":"https://api.github.com/repos/Ian-Foote/django-conman/stargazers","contributors_url":"https://api.github.com/repos/Ian-Foote/django-conman/contributors","subscribers_url":"https://api.github.com/repos/Ian-Foote/django-conman/subscribers","subscription_url":"https://api.github.com/repos/Ian-Foote/django-conman/subscription","commits_url":"https://api.github.com/repos/Ian-Foote/django-conman/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ian-Foote/django-conman/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ian-Foote/django-conman/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ian-Foote/django-conman/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ian-Foote/django-conman/contents/{+path}","compare_url":"https://api.github.com/repos/Ian-Foote/django-conman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ian-Foote/django-conman/merges","archive_url":"https://api.github.com/repos/Ian-Foote/django-conman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ian-Foote/django-conman/downloads","issues_url":"https://api.github.com/repos/Ian-Foote/django-conman/issues{/number}","pulls_url":"https://api.github.com/repos/Ian-Foote/django-conman/pulls{/number}","milestones_url":"https://api.github.com/repos/Ian-Foote/django-conman/milestones{/number}","notifications_url":"https://api.github.com/repos/Ian-Foote/django-conman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ian-Foote/django-conman/labels{/name}","releases_url":"https://api.github.com/repos/Ian-Foote/django-conman/releases{/id}","created_at":"2014-10-07T20:37:32Z","updated_at":"2014-10-07T23:03:53Z","pushed_at":"2015-08-08T13:30:14Z","git_url":"git://github.com/Ian-Foote/django-conman.git","ssh_url":"git@github.com:Ian-Foote/django-conman.git","clone_url":"https://github.com/Ian-Foote/django-conman.git","svn_url":"https://github.com/Ian-Foote/django-conman","homepage":"","size":363,"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":"meshy:master","ref":"master","sha":"838ff7eb1d331f382ce4dfb61d5c89e84cfff928","user":{"login":"meshy","id":767671,"avatar_url":"https://avatars.githubusercontent.com/u/767671?v=3","gravatar_id":"","url":"https://api.github.com/users/meshy","html_url":"https://github.com/meshy","followers_url":"https://api.github.com/users/meshy/followers","following_url":"https://api.github.com/users/meshy/following{/other_user}","gists_url":"https://api.github.com/users/meshy/gists{/gist_id}","starred_url":"https://api.github.com/users/meshy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meshy/subscriptions","organizations_url":"https://api.github.com/users/meshy/orgs","repos_url":"https://api.github.com/users/meshy/repos","events_url":"https://api.github.com/users/meshy/events{/privacy}","received_events_url":"https://api.github.com/users/meshy/received_events","type":"User","site_admin":false},"repo":{"id":23807475,"name":"django-conman","full_name":"meshy/django-conman","owner":{"login":"meshy","id":767671,"avatar_url":"https://avatars.githubusercontent.com/u/767671?v=3","gravatar_id":"","url":"https://api.github.com/users/meshy","html_url":"https://github.com/meshy","followers_url":"https://api.github.com/users/meshy/followers","following_url":"https://api.github.com/users/meshy/following{/other_user}","gists_url":"https://api.github.com/users/meshy/gists{/gist_id}","starred_url":"https://api.github.com/users/meshy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meshy/subscriptions","organizations_url":"https://api.github.com/users/meshy/orgs","repos_url":"https://api.github.com/users/meshy/repos","events_url":"https://api.github.com/users/meshy/events{/privacy}","received_events_url":"https://api.github.com/users/meshy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meshy/django-conman","description":"A content management system for django","fork":false,"url":"https://api.github.com/repos/meshy/django-conman","forks_url":"https://api.github.com/repos/meshy/django-conman/forks","keys_url":"https://api.github.com/repos/meshy/django-conman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meshy/django-conman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meshy/django-conman/teams","hooks_url":"https://api.github.com/repos/meshy/django-conman/hooks","issue_events_url":"https://api.github.com/repos/meshy/django-conman/issues/events{/number}","events_url":"https://api.github.com/repos/meshy/django-conman/events","assignees_url":"https://api.github.com/repos/meshy/django-conman/assignees{/user}","branches_url":"https://api.github.com/repos/meshy/django-conman/branches{/branch}","tags_url":"https://api.github.com/repos/meshy/django-conman/tags","blobs_url":"https://api.github.com/repos/meshy/django-conman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meshy/django-conman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meshy/django-conman/git/refs{/sha}","trees_url":"https://api.github.com/repos/meshy/django-conman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meshy/django-conman/statuses/{sha}","languages_url":"https://api.github.com/repos/meshy/django-conman/languages","stargazers_url":"https://api.github.com/repos/meshy/django-conman/stargazers","contributors_url":"https://api.github.com/repos/meshy/django-conman/contributors","subscribers_url":"https://api.github.com/repos/meshy/django-conman/subscribers","subscription_url":"https://api.github.com/repos/meshy/django-conman/subscription","commits_url":"https://api.github.com/repos/meshy/django-conman/commits{/sha}","git_commits_url":"https://api.github.com/repos/meshy/django-conman/git/commits{/sha}","comments_url":"https://api.github.com/repos/meshy/django-conman/comments{/number}","issue_comment_url":"https://api.github.com/repos/meshy/django-conman/issues/comments{/number}","contents_url":"https://api.github.com/repos/meshy/django-conman/contents/{+path}","compare_url":"https://api.github.com/repos/meshy/django-conman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meshy/django-conman/merges","archive_url":"https://api.github.com/repos/meshy/django-conman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meshy/django-conman/downloads","issues_url":"https://api.github.com/repos/meshy/django-conman/issues{/number}","pulls_url":"https://api.github.com/repos/meshy/django-conman/pulls{/number}","milestones_url":"https://api.github.com/repos/meshy/django-conman/milestones{/number}","notifications_url":"https://api.github.com/repos/meshy/django-conman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meshy/django-conman/labels{/name}","releases_url":"https://api.github.com/repos/meshy/django-conman/releases{/id}","created_at":"2014-09-08T20:40:27Z","updated_at":"2014-10-10T04:19:53Z","pushed_at":"2015-08-08T13:30:51Z","git_url":"git://github.com/meshy/django-conman.git","ssh_url":"git@github.com:meshy/django-conman.git","clone_url":"https://github.com/meshy/django-conman.git","svn_url":"https://github.com/meshy/django-conman","homepage":"","size":1040,"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":11,"forks":2,"open_issues":11,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/meshy/django-conman/pulls/69"},"html":{"href":"https://github.com/meshy/django-conman/pull/69"},"issue":{"href":"https://api.github.com/repos/meshy/django-conman/issues/69"},"comments":{"href":"https://api.github.com/repos/meshy/django-conman/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/meshy/django-conman/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/meshy/django-conman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/meshy/django-conman/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/meshy/django-conman/statuses/4e65adb0875b2fce224b54615672040a9f9a8c02"}}}}