{"action":"created","comment":{"url":"https://api.github.com/repos/inspirehep/inspire-next/pulls/comments/69735931","id":69735931,"diff_hunk":"@@ -56,55 +61,105 @@ def get_valid_pubnotes(pubnotes):\n                     raw_references.append(pubnote)\n         return valid_pubnotes, raw_references\n \n-    def get_value(value):\n-        recid = None\n-        number = ''\n-        year = ''\n-        if '0' in value:\n-            try:\n-                recid = int(value.get('0'))\n-            except:\n-                pass\n-        if 'o' in value:\n-            try:\n-                number = int(value.get('o'))\n-            except:\n-                pass\n-        if 'y' in value:\n-            try:\n-                year = int(value.get('y'))\n-            except:\n-                pass\n+    def force_force_list(obj):\n+        return list(utils.force_list(obj) or [])\n \n+    def get_value(value):\n+        # Retrieve fields as described here:\n+        # https://twiki.cern.ch/twiki/bin/view/Inspire/DevelopmentRecordMarkup.\n+\n+        # Reference specific.\n+        recid = get_int_value(value, '0')\n+        number = get_int_value(value, 'o')\n+        misc = force_force_list(value.get('m'))\n+        raw_references = force_force_list(value.get('x'))\n+        urls = force_force_list(value.get('u'))\n+        texkey = force_single_element(value.get('1'))\n+\n+        # Publication info specific.\n+        cnum = force_single_element(value.get('b'))","path":"inspirehep/dojson/hep/fields/bd90x99x.py","position":64,"original_position":64,"commit_id":"a4fcd5303a4cc658f203d41f14d5b5e9b204b491","original_commit_id":"a4fcd5303a4cc658f203d41f14d5b5e9b204b491","user":{"login":"kaplun","id":119349,"avatar_url":"https://avatars.githubusercontent.com/u/119349?v=3","gravatar_id":"","url":"https://api.github.com/users/kaplun","html_url":"https://github.com/kaplun","followers_url":"https://api.github.com/users/kaplun/followers","following_url":"https://api.github.com/users/kaplun/following{/other_user}","gists_url":"https://api.github.com/users/kaplun/gists{/gist_id}","starred_url":"https://api.github.com/users/kaplun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaplun/subscriptions","organizations_url":"https://api.github.com/users/kaplun/orgs","repos_url":"https://api.github.com/users/kaplun/repos","events_url":"https://api.github.com/users/kaplun/events{/privacy}","received_events_url":"https://api.github.com/users/kaplun/received_events","type":"User","site_admin":false},"body":"CNUM have a regexp to check them `C\\d\\d-\\d\\d-\\d\\d(\\.\\d+)` (I think)","created_at":"2016-07-06T14:04:45Z","updated_at":"2016-07-06T14:04:45Z","html_url":"https://github.com/inspirehep/inspire-next/pull/1279#discussion_r69735931","pull_request_url":"https://api.github.com/repos/inspirehep/inspire-next/pulls/1279","_links":{"self":{"href":"https://api.github.com/repos/inspirehep/inspire-next/pulls/comments/69735931"},"html":{"href":"https://github.com/inspirehep/inspire-next/pull/1279#discussion_r69735931"},"pull_request":{"href":"https://api.github.com/repos/inspirehep/inspire-next/pulls/1279"}}},"pull_request":{"url":"https://api.github.com/repos/inspirehep/inspire-next/pulls/1279","id":75815625,"html_url":"https://github.com/inspirehep/inspire-next/pull/1279","diff_url":"https://github.com/inspirehep/inspire-next/pull/1279.diff","patch_url":"https://github.com/inspirehep/inspire-next/pull/1279.patch","issue_url":"https://api.github.com/repos/inspirehep/inspire-next/issues/1279","number":1279,"state":"open","locked":false,"title":"WIP jsonschema: pumped up references","user":{"login":"mihaibivol","id":490125,"avatar_url":"https://avatars.githubusercontent.com/u/490125?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaibivol","html_url":"https://github.com/mihaibivol","followers_url":"https://api.github.com/users/mihaibivol/followers","following_url":"https://api.github.com/users/mihaibivol/following{/other_user}","gists_url":"https://api.github.com/users/mihaibivol/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaibivol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaibivol/subscriptions","organizations_url":"https://api.github.com/users/mihaibivol/orgs","repos_url":"https://api.github.com/users/mihaibivol/repos","events_url":"https://api.github.com/users/mihaibivol/events{/privacy}","received_events_url":"https://api.github.com/users/mihaibivol/received_events","type":"User","site_admin":false},"body":"## Provide a `hep`-like reference field inside `hep` references\r\nCloses #430\r\n\r\n* [x] Add reference new schema (similar to `hep`)\r\n* [ ] Fix mapping\r\n* [ ] Amend `dojson` to work with this new schema\r\n* [ ] Amend `hepcrawl` to work with this new schema\r\n* [ ] Amend HEP Detail View to work with this new schema\r\n\r\n* [ ] Create follow-up issue for merging good ideas into the `hep` schema\r\n","created_at":"2016-06-30T13:05:24Z","updated_at":"2016-07-06T14:04:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d7ee40d7ad7f46f47c6d2684eafa3c5b50711ec","assignee":{"login":"mihaibivol","id":490125,"avatar_url":"https://avatars.githubusercontent.com/u/490125?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaibivol","html_url":"https://github.com/mihaibivol","followers_url":"https://api.github.com/users/mihaibivol/followers","following_url":"https://api.github.com/users/mihaibivol/following{/other_user}","gists_url":"https://api.github.com/users/mihaibivol/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaibivol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaibivol/subscriptions","organizations_url":"https://api.github.com/users/mihaibivol/orgs","repos_url":"https://api.github.com/users/mihaibivol/repos","events_url":"https://api.github.com/users/mihaibivol/events{/privacy}","received_events_url":"https://api.github.com/users/mihaibivol/received_events","type":"User","site_admin":false},"assignees":[{"login":"mihaibivol","id":490125,"avatar_url":"https://avatars.githubusercontent.com/u/490125?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaibivol","html_url":"https://github.com/mihaibivol","followers_url":"https://api.github.com/users/mihaibivol/followers","following_url":"https://api.github.com/users/mihaibivol/following{/other_user}","gists_url":"https://api.github.com/users/mihaibivol/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaibivol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaibivol/subscriptions","organizations_url":"https://api.github.com/users/mihaibivol/orgs","repos_url":"https://api.github.com/users/mihaibivol/repos","events_url":"https://api.github.com/users/mihaibivol/events{/privacy}","received_events_url":"https://api.github.com/users/mihaibivol/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/inspirehep/inspire-next/milestones/14","html_url":"https://github.com/inspirehep/inspire-next/milestones/Information%20architecture%20-%20third%20iteration","labels_url":"https://api.github.com/repos/inspirehep/inspire-next/milestones/14/labels","id":1455754,"number":14,"title":"Information architecture - third iteration","description":"","creator":{"login":"jmartinm","id":580727,"avatar_url":"https://avatars.githubusercontent.com/u/580727?v=3","gravatar_id":"","url":"https://api.github.com/users/jmartinm","html_url":"https://github.com/jmartinm","followers_url":"https://api.github.com/users/jmartinm/followers","following_url":"https://api.github.com/users/jmartinm/following{/other_user}","gists_url":"https://api.github.com/users/jmartinm/gists{/gist_id}","starred_url":"https://api.github.com/users/jmartinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmartinm/subscriptions","organizations_url":"https://api.github.com/users/jmartinm/orgs","repos_url":"https://api.github.com/users/jmartinm/repos","events_url":"https://api.github.com/users/jmartinm/events{/privacy}","received_events_url":"https://api.github.com/users/jmartinm/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":37,"state":"open","created_at":"2015-12-11T10:33:17Z","updated_at":"2016-06-30T14:15:35Z","due_on":"2016-05-30T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/inspirehep/inspire-next/pulls/1279/commits","review_comments_url":"https://api.github.com/repos/inspirehep/inspire-next/pulls/1279/comments","review_comment_url":"https://api.github.com/repos/inspirehep/inspire-next/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inspirehep/inspire-next/issues/1279/comments","statuses_url":"https://api.github.com/repos/inspirehep/inspire-next/statuses/a4fcd5303a4cc658f203d41f14d5b5e9b204b491","head":{"label":"mihaibivol:references-schema","ref":"references-schema","sha":"a4fcd5303a4cc658f203d41f14d5b5e9b204b491","user":{"login":"mihaibivol","id":490125,"avatar_url":"https://avatars.githubusercontent.com/u/490125?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaibivol","html_url":"https://github.com/mihaibivol","followers_url":"https://api.github.com/users/mihaibivol/followers","following_url":"https://api.github.com/users/mihaibivol/following{/other_user}","gists_url":"https://api.github.com/users/mihaibivol/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaibivol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaibivol/subscriptions","organizations_url":"https://api.github.com/users/mihaibivol/orgs","repos_url":"https://api.github.com/users/mihaibivol/repos","events_url":"https://api.github.com/users/mihaibivol/events{/privacy}","received_events_url":"https://api.github.com/users/mihaibivol/received_events","type":"User","site_admin":false},"repo":{"id":52959660,"name":"inspire-next","full_name":"mihaibivol/inspire-next","owner":{"login":"mihaibivol","id":490125,"avatar_url":"https://avatars.githubusercontent.com/u/490125?v=3","gravatar_id":"","url":"https://api.github.com/users/mihaibivol","html_url":"https://github.com/mihaibivol","followers_url":"https://api.github.com/users/mihaibivol/followers","following_url":"https://api.github.com/users/mihaibivol/following{/other_user}","gists_url":"https://api.github.com/users/mihaibivol/gists{/gist_id}","starred_url":"https://api.github.com/users/mihaibivol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mihaibivol/subscriptions","organizations_url":"https://api.github.com/users/mihaibivol/orgs","repos_url":"https://api.github.com/users/mihaibivol/repos","events_url":"https://api.github.com/users/mihaibivol/events{/privacy}","received_events_url":"https://api.github.com/users/mihaibivol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mihaibivol/inspire-next","description":"INSPIRE overlay repository to be used with https://github.com/inspirehep/invenio@labs branch","fork":true,"url":"https://api.github.com/repos/mihaibivol/inspire-next","forks_url":"https://api.github.com/repos/mihaibivol/inspire-next/forks","keys_url":"https://api.github.com/repos/mihaibivol/inspire-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mihaibivol/inspire-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mihaibivol/inspire-next/teams","hooks_url":"https://api.github.com/repos/mihaibivol/inspire-next/hooks","issue_events_url":"https://api.github.com/repos/mihaibivol/inspire-next/issues/events{/number}","events_url":"https://api.github.com/repos/mihaibivol/inspire-next/events","assignees_url":"https://api.github.com/repos/mihaibivol/inspire-next/assignees{/user}","branches_url":"https://api.github.com/repos/mihaibivol/inspire-next/branches{/branch}","tags_url":"https://api.github.com/repos/mihaibivol/inspire-next/tags","blobs_url":"https://api.github.com/repos/mihaibivol/inspire-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mihaibivol/inspire-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mihaibivol/inspire-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/mihaibivol/inspire-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mihaibivol/inspire-next/statuses/{sha}","languages_url":"https://api.github.com/repos/mihaibivol/inspire-next/languages","stargazers_url":"https://api.github.com/repos/mihaibivol/inspire-next/stargazers","contributors_url":"https://api.github.com/repos/mihaibivol/inspire-next/contributors","subscribers_url":"https://api.github.com/repos/mihaibivol/inspire-next/subscribers","subscription_url":"https://api.github.com/repos/mihaibivol/inspire-next/subscription","commits_url":"https://api.github.com/repos/mihaibivol/inspire-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/mihaibivol/inspire-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/mihaibivol/inspire-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/mihaibivol/inspire-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/mihaibivol/inspire-next/contents/{+path}","compare_url":"https://api.github.com/repos/mihaibivol/inspire-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mihaibivol/inspire-next/merges","archive_url":"https://api.github.com/repos/mihaibivol/inspire-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mihaibivol/inspire-next/downloads","issues_url":"https://api.github.com/repos/mihaibivol/inspire-next/issues{/number}","pulls_url":"https://api.github.com/repos/mihaibivol/inspire-next/pulls{/number}","milestones_url":"https://api.github.com/repos/mihaibivol/inspire-next/milestones{/number}","notifications_url":"https://api.github.com/repos/mihaibivol/inspire-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mihaibivol/inspire-next/labels{/name}","releases_url":"https://api.github.com/repos/mihaibivol/inspire-next/releases{/id}","deployments_url":"https://api.github.com/repos/mihaibivol/inspire-next/deployments","created_at":"2016-03-02T12:03:55Z","updated_at":"2016-03-02T12:03:57Z","pushed_at":"2016-07-06T13:07:56Z","git_url":"git://github.com/mihaibivol/inspire-next.git","ssh_url":"git@github.com:mihaibivol/inspire-next.git","clone_url":"https://github.com/mihaibivol/inspire-next.git","svn_url":"https://github.com/mihaibivol/inspire-next","homepage":"https://labs.inspirehep.net","size":59791,"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":"invenio3"}},"base":{"label":"inspirehep:master","ref":"master","sha":"911b9f53fc6836953ccff397e75310f03081ca54","user":{"login":"inspirehep","id":356664,"avatar_url":"https://avatars.githubusercontent.com/u/356664?v=3","gravatar_id":"","url":"https://api.github.com/users/inspirehep","html_url":"https://github.com/inspirehep","followers_url":"https://api.github.com/users/inspirehep/followers","following_url":"https://api.github.com/users/inspirehep/following{/other_user}","gists_url":"https://api.github.com/users/inspirehep/gists{/gist_id}","starred_url":"https://api.github.com/users/inspirehep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inspirehep/subscriptions","organizations_url":"https://api.github.com/users/inspirehep/orgs","repos_url":"https://api.github.com/users/inspirehep/repos","events_url":"https://api.github.com/users/inspirehep/events{/privacy}","received_events_url":"https://api.github.com/users/inspirehep/received_events","type":"Organization","site_admin":false},"repo":{"id":15221515,"name":"inspire-next","full_name":"inspirehep/inspire-next","owner":{"login":"inspirehep","id":356664,"avatar_url":"https://avatars.githubusercontent.com/u/356664?v=3","gravatar_id":"","url":"https://api.github.com/users/inspirehep","html_url":"https://github.com/inspirehep","followers_url":"https://api.github.com/users/inspirehep/followers","following_url":"https://api.github.com/users/inspirehep/following{/other_user}","gists_url":"https://api.github.com/users/inspirehep/gists{/gist_id}","starred_url":"https://api.github.com/users/inspirehep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inspirehep/subscriptions","organizations_url":"https://api.github.com/users/inspirehep/orgs","repos_url":"https://api.github.com/users/inspirehep/repos","events_url":"https://api.github.com/users/inspirehep/events{/privacy}","received_events_url":"https://api.github.com/users/inspirehep/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inspirehep/inspire-next","description":"INSPIRE overlay repository to be used with https://github.com/inspirehep/invenio@labs branch","fork":false,"url":"https://api.github.com/repos/inspirehep/inspire-next","forks_url":"https://api.github.com/repos/inspirehep/inspire-next/forks","keys_url":"https://api.github.com/repos/inspirehep/inspire-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inspirehep/inspire-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inspirehep/inspire-next/teams","hooks_url":"https://api.github.com/repos/inspirehep/inspire-next/hooks","issue_events_url":"https://api.github.com/repos/inspirehep/inspire-next/issues/events{/number}","events_url":"https://api.github.com/repos/inspirehep/inspire-next/events","assignees_url":"https://api.github.com/repos/inspirehep/inspire-next/assignees{/user}","branches_url":"https://api.github.com/repos/inspirehep/inspire-next/branches{/branch}","tags_url":"https://api.github.com/repos/inspirehep/inspire-next/tags","blobs_url":"https://api.github.com/repos/inspirehep/inspire-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inspirehep/inspire-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inspirehep/inspire-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/inspirehep/inspire-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inspirehep/inspire-next/statuses/{sha}","languages_url":"https://api.github.com/repos/inspirehep/inspire-next/languages","stargazers_url":"https://api.github.com/repos/inspirehep/inspire-next/stargazers","contributors_url":"https://api.github.com/repos/inspirehep/inspire-next/contributors","subscribers_url":"https://api.github.com/repos/inspirehep/inspire-next/subscribers","subscription_url":"https://api.github.com/repos/inspirehep/inspire-next/subscription","commits_url":"https://api.github.com/repos/inspirehep/inspire-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/inspirehep/inspire-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/inspirehep/inspire-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/inspirehep/inspire-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/inspirehep/inspire-next/contents/{+path}","compare_url":"https://api.github.com/repos/inspirehep/inspire-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inspirehep/inspire-next/merges","archive_url":"https://api.github.com/repos/inspirehep/inspire-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inspirehep/inspire-next/downloads","issues_url":"https://api.github.com/repos/inspirehep/inspire-next/issues{/number}","pulls_url":"https://api.github.com/repos/inspirehep/inspire-next/pulls{/number}","milestones_url":"https://api.github.com/repos/inspirehep/inspire-next/milestones{/number}","notifications_url":"https://api.github.com/repos/inspirehep/inspire-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inspirehep/inspire-next/labels{/name}","releases_url":"https://api.github.com/repos/inspirehep/inspire-next/releases{/id}","deployments_url":"https://api.github.com/repos/inspirehep/inspire-next/deployments","created_at":"2013-12-16T09:11:58Z","updated_at":"2016-07-04T13:13:58Z","pushed_at":"2016-07-06T13:44:03Z","git_url":"git://github.com/inspirehep/inspire-next.git","ssh_url":"git@github.com:inspirehep/inspire-next.git","clone_url":"https://github.com/inspirehep/inspire-next.git","svn_url":"https://github.com/inspirehep/inspire-next","homepage":"https://labs.inspirehep.net","size":64665,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":140,"forks":32,"open_issues":140,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inspirehep/inspire-next/pulls/1279"},"html":{"href":"https://github.com/inspirehep/inspire-next/pull/1279"},"issue":{"href":"https://api.github.com/repos/inspirehep/inspire-next/issues/1279"},"comments":{"href":"https://api.github.com/repos/inspirehep/inspire-next/issues/1279/comments"},"review_comments":{"href":"https://api.github.com/repos/inspirehep/inspire-next/pulls/1279/comments"},"review_comment":{"href":"https://api.github.com/repos/inspirehep/inspire-next/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inspirehep/inspire-next/pulls/1279/commits"},"statuses":{"href":"https://api.github.com/repos/inspirehep/inspire-next/statuses/a4fcd5303a4cc658f203d41f14d5b5e9b204b491"}}}}
{"actor":{"display_login":"kaplun"}}