{"action":"created","comment":{"url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/comments/125531660","pull_request_review_id":47926352,"id":125531660,"diff_hunk":"@@ -255,3 +267,49 @@ def create_notify(task, report):\n     send_found_notify(notify)\n     notify.save()\n     return notify\n+\n+\n+def save_search_task(user, query, deepsearch=True, query_params='', chat_data=''):\n+    if len(query) < 2:\n+        raise ValueError('Не вдалось створити завдання з пустим запитом.')\n+\n+    if len(query) > 100 or len(query.split(' ')) > 10:\n+        raise ValueError('Не вдалось створити завдання з таким довгим запитом.')\n+\n+    if not user.email:\n+        raise ValueError('Не вдалось створити завдання без адреси електронної пошти.')\n+\n+    # don't add twice\n+    if SearchTask.objects.filter(user=user, query=query,\n+            deepsearch=deepsearch, query_params=query_params, is_deleted=False).exists():\n+        raise ValueError('Таке завдання вже існує.')\n+\n+    task = SearchTask(user=user, query=query, deepsearch=deepsearch)\n+    task.query_params = query_params\n+    task.chat_data = chat_data\n+    task.save()\n+\n+    if not first_run(task):","path":"declarations_site/spotter/utils.py","position":68,"original_position":68,"commit_id":"f26a5421e5b887e1e5a174d8adea012fd89c5241","original_commit_id":"f26a5421e5b887e1e5a174d8adea012fd89c5241","user":{"login":"dchaplinsky","id":131186,"avatar_url":"https://avatars0.githubusercontent.com/u/131186?v=3","gravatar_id":"","url":"https://api.github.com/users/dchaplinsky","html_url":"https://github.com/dchaplinsky","followers_url":"https://api.github.com/users/dchaplinsky/followers","following_url":"https://api.github.com/users/dchaplinsky/following{/other_user}","gists_url":"https://api.github.com/users/dchaplinsky/gists{/gist_id}","starred_url":"https://api.github.com/users/dchaplinsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchaplinsky/subscriptions","organizations_url":"https://api.github.com/users/dchaplinsky/orgs","repos_url":"https://api.github.com/users/dchaplinsky/repos","events_url":"https://api.github.com/users/dchaplinsky/events{/privacy}","received_events_url":"https://api.github.com/users/dchaplinsky/received_events","type":"User","site_admin":false},"body":"Again, ideally you should raise an exception in first_run and here you should catch it (rather rely on implicit implementation details).","created_at":"2017-07-04T21:39:41Z","updated_at":"2017-07-04T21:45:24Z","html_url":"https://github.com/dchaplinsky/declarations.com.ua/pull/106#discussion_r125531660","pull_request_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/106","_links":{"self":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/comments/125531660"},"html":{"href":"https://github.com/dchaplinsky/declarations.com.ua/pull/106#discussion_r125531660"},"pull_request":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/106"}}},"pull_request":{"url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/106","id":128848635,"html_url":"https://github.com/dchaplinsky/declarations.com.ua/pull/106","diff_url":"https://github.com/dchaplinsky/declarations.com.ua/pull/106.diff","patch_url":"https://github.com/dchaplinsky/declarations.com.ua/pull/106.patch","issue_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/issues/106","number":106,"state":"open","locked":false,"title":"Chatbot with subscription","user":{"login":"imaginal","id":2058546,"avatar_url":"https://avatars2.githubusercontent.com/u/2058546?v=3","gravatar_id":"","url":"https://api.github.com/users/imaginal","html_url":"https://github.com/imaginal","followers_url":"https://api.github.com/users/imaginal/followers","following_url":"https://api.github.com/users/imaginal/following{/other_user}","gists_url":"https://api.github.com/users/imaginal/gists{/gist_id}","starred_url":"https://api.github.com/users/imaginal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imaginal/subscriptions","organizations_url":"https://api.github.com/users/imaginal/orgs","repos_url":"https://api.github.com/users/imaginal/repos","events_url":"https://api.github.com/users/imaginal/events{/privacy}","received_events_url":"https://api.github.com/users/imaginal/received_events","type":"User","site_admin":false},"body":"1. Chatbot subscription and pagination\r\n2. Now all requests in chatbot with retry\r\n3. Two DATABASE migrations\r\n4. Make less search results in chat (now 5 was 10) but now with pagination\r\n5. Can paginate through found_new in subscribtions\r\n\r\nNon chatbot\r\n1. Add sorting by intro.date\r\n2. Try use minimum_should_match from 4 words in query (was 3 words)\r\n3. Fix ukraine plural for number gt 100","created_at":"2017-07-04T19:08:06Z","updated_at":"2017-07-04T21:45:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa268088627b5bc74ec33b419b89e70e60a79149","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/106/commits","review_comments_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/106/comments","review_comment_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/issues/106/comments","statuses_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/statuses/f26a5421e5b887e1e5a174d8adea012fd89c5241","head":{"label":"imaginal:chatbot","ref":"chatbot","sha":"f26a5421e5b887e1e5a174d8adea012fd89c5241","user":{"login":"imaginal","id":2058546,"avatar_url":"https://avatars2.githubusercontent.com/u/2058546?v=3","gravatar_id":"","url":"https://api.github.com/users/imaginal","html_url":"https://github.com/imaginal","followers_url":"https://api.github.com/users/imaginal/followers","following_url":"https://api.github.com/users/imaginal/following{/other_user}","gists_url":"https://api.github.com/users/imaginal/gists{/gist_id}","starred_url":"https://api.github.com/users/imaginal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imaginal/subscriptions","organizations_url":"https://api.github.com/users/imaginal/orgs","repos_url":"https://api.github.com/users/imaginal/repos","events_url":"https://api.github.com/users/imaginal/events{/privacy}","received_events_url":"https://api.github.com/users/imaginal/received_events","type":"User","site_admin":false},"repo":{"id":84671254,"name":"declarations.com.ua","full_name":"imaginal/declarations.com.ua","owner":{"login":"imaginal","id":2058546,"avatar_url":"https://avatars2.githubusercontent.com/u/2058546?v=3","gravatar_id":"","url":"https://api.github.com/users/imaginal","html_url":"https://github.com/imaginal","followers_url":"https://api.github.com/users/imaginal/followers","following_url":"https://api.github.com/users/imaginal/following{/other_user}","gists_url":"https://api.github.com/users/imaginal/gists{/gist_id}","starred_url":"https://api.github.com/users/imaginal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imaginal/subscriptions","organizations_url":"https://api.github.com/users/imaginal/orgs","repos_url":"https://api.github.com/users/imaginal/repos","events_url":"https://api.github.com/users/imaginal/events{/privacy}","received_events_url":"https://api.github.com/users/imaginal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/imaginal/declarations.com.ua","description":"Our project to digitaze and open all declaration of ukrainian officials","fork":true,"url":"https://api.github.com/repos/imaginal/declarations.com.ua","forks_url":"https://api.github.com/repos/imaginal/declarations.com.ua/forks","keys_url":"https://api.github.com/repos/imaginal/declarations.com.ua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/imaginal/declarations.com.ua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/imaginal/declarations.com.ua/teams","hooks_url":"https://api.github.com/repos/imaginal/declarations.com.ua/hooks","issue_events_url":"https://api.github.com/repos/imaginal/declarations.com.ua/issues/events{/number}","events_url":"https://api.github.com/repos/imaginal/declarations.com.ua/events","assignees_url":"https://api.github.com/repos/imaginal/declarations.com.ua/assignees{/user}","branches_url":"https://api.github.com/repos/imaginal/declarations.com.ua/branches{/branch}","tags_url":"https://api.github.com/repos/imaginal/declarations.com.ua/tags","blobs_url":"https://api.github.com/repos/imaginal/declarations.com.ua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/imaginal/declarations.com.ua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/imaginal/declarations.com.ua/git/refs{/sha}","trees_url":"https://api.github.com/repos/imaginal/declarations.com.ua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/imaginal/declarations.com.ua/statuses/{sha}","languages_url":"https://api.github.com/repos/imaginal/declarations.com.ua/languages","stargazers_url":"https://api.github.com/repos/imaginal/declarations.com.ua/stargazers","contributors_url":"https://api.github.com/repos/imaginal/declarations.com.ua/contributors","subscribers_url":"https://api.github.com/repos/imaginal/declarations.com.ua/subscribers","subscription_url":"https://api.github.com/repos/imaginal/declarations.com.ua/subscription","commits_url":"https://api.github.com/repos/imaginal/declarations.com.ua/commits{/sha}","git_commits_url":"https://api.github.com/repos/imaginal/declarations.com.ua/git/commits{/sha}","comments_url":"https://api.github.com/repos/imaginal/declarations.com.ua/comments{/number}","issue_comment_url":"https://api.github.com/repos/imaginal/declarations.com.ua/issues/comments{/number}","contents_url":"https://api.github.com/repos/imaginal/declarations.com.ua/contents/{+path}","compare_url":"https://api.github.com/repos/imaginal/declarations.com.ua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/imaginal/declarations.com.ua/merges","archive_url":"https://api.github.com/repos/imaginal/declarations.com.ua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/imaginal/declarations.com.ua/downloads","issues_url":"https://api.github.com/repos/imaginal/declarations.com.ua/issues{/number}","pulls_url":"https://api.github.com/repos/imaginal/declarations.com.ua/pulls{/number}","milestones_url":"https://api.github.com/repos/imaginal/declarations.com.ua/milestones{/number}","notifications_url":"https://api.github.com/repos/imaginal/declarations.com.ua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/imaginal/declarations.com.ua/labels{/name}","releases_url":"https://api.github.com/repos/imaginal/declarations.com.ua/releases{/id}","deployments_url":"https://api.github.com/repos/imaginal/declarations.com.ua/deployments","created_at":"2017-03-11T18:28:51Z","updated_at":"2017-03-11T18:28:54Z","pushed_at":"2017-07-04T19:00:56Z","git_url":"git://github.com/imaginal/declarations.com.ua.git","ssh_url":"git@github.com:imaginal/declarations.com.ua.git","clone_url":"https://github.com/imaginal/declarations.com.ua.git","svn_url":"https://github.com/imaginal/declarations.com.ua","homepage":"http://declarations.com.ua","size":19224,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_projects":true,"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":"dchaplinsky:master","ref":"master","sha":"cdb6225a3b3cd2c4ae8febaf6e34613453a817bd","user":{"login":"dchaplinsky","id":131186,"avatar_url":"https://avatars0.githubusercontent.com/u/131186?v=3","gravatar_id":"","url":"https://api.github.com/users/dchaplinsky","html_url":"https://github.com/dchaplinsky","followers_url":"https://api.github.com/users/dchaplinsky/followers","following_url":"https://api.github.com/users/dchaplinsky/following{/other_user}","gists_url":"https://api.github.com/users/dchaplinsky/gists{/gist_id}","starred_url":"https://api.github.com/users/dchaplinsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchaplinsky/subscriptions","organizations_url":"https://api.github.com/users/dchaplinsky/orgs","repos_url":"https://api.github.com/users/dchaplinsky/repos","events_url":"https://api.github.com/users/dchaplinsky/events{/privacy}","received_events_url":"https://api.github.com/users/dchaplinsky/received_events","type":"User","site_admin":false},"repo":{"id":31430527,"name":"declarations.com.ua","full_name":"dchaplinsky/declarations.com.ua","owner":{"login":"dchaplinsky","id":131186,"avatar_url":"https://avatars0.githubusercontent.com/u/131186?v=3","gravatar_id":"","url":"https://api.github.com/users/dchaplinsky","html_url":"https://github.com/dchaplinsky","followers_url":"https://api.github.com/users/dchaplinsky/followers","following_url":"https://api.github.com/users/dchaplinsky/following{/other_user}","gists_url":"https://api.github.com/users/dchaplinsky/gists{/gist_id}","starred_url":"https://api.github.com/users/dchaplinsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchaplinsky/subscriptions","organizations_url":"https://api.github.com/users/dchaplinsky/orgs","repos_url":"https://api.github.com/users/dchaplinsky/repos","events_url":"https://api.github.com/users/dchaplinsky/events{/privacy}","received_events_url":"https://api.github.com/users/dchaplinsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dchaplinsky/declarations.com.ua","description":"Our project to digitaze and open all declaration of ukrainian officials","fork":false,"url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua","forks_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/forks","keys_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/teams","hooks_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/hooks","issue_events_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/issues/events{/number}","events_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/events","assignees_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/assignees{/user}","branches_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/branches{/branch}","tags_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/tags","blobs_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/git/refs{/sha}","trees_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/statuses/{sha}","languages_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/languages","stargazers_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/stargazers","contributors_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/contributors","subscribers_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/subscribers","subscription_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/subscription","commits_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/commits{/sha}","git_commits_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/git/commits{/sha}","comments_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/comments{/number}","issue_comment_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/issues/comments{/number}","contents_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/contents/{+path}","compare_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/merges","archive_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/downloads","issues_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/issues{/number}","pulls_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls{/number}","milestones_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/milestones{/number}","notifications_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/labels{/name}","releases_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/releases{/id}","deployments_url":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/deployments","created_at":"2015-02-27T17:22:48Z","updated_at":"2017-05-18T11:43:48Z","pushed_at":"2017-07-04T19:08:06Z","git_url":"git://github.com/dchaplinsky/declarations.com.ua.git","ssh_url":"git@github.com:dchaplinsky/declarations.com.ua.git","clone_url":"https://github.com/dchaplinsky/declarations.com.ua.git","svn_url":"https://github.com/dchaplinsky/declarations.com.ua","homepage":"http://declarations.com.ua","size":19257,"stargazers_count":19,"watchers_count":19,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":7,"forks":10,"open_issues":7,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/106"},"html":{"href":"https://github.com/dchaplinsky/declarations.com.ua/pull/106"},"issue":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/issues/106"},"comments":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/issues/106/comments"},"review_comments":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/106/comments"},"review_comment":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/pulls/106/commits"},"statuses":{"href":"https://api.github.com/repos/dchaplinsky/declarations.com.ua/statuses/f26a5421e5b887e1e5a174d8adea012fd89c5241"}}}}
{"actor":{"display_login":"dchaplinsky"}}