{"action":"created","comment":{"url":"https://api.github.com/repos/DOAJ/doaj/pulls/comments/54431622","id":54431622,"diff_hunk":"@@ -125,7 +125,18 @@ def normalise_issn(issn):\n             issn = (\"0\" * (8 - len(issn))) + issn\n             return issn[:4] + \"-\" + issn[4:]\n \n+\n def load_file(filename):\n     with open(filename, 'rb') as f:\n         content = f.read()\n-    return content\n\\ No newline at end of file\n+    return content\n+\n+\n+def unicode_dict(d):\n+    \"\"\" Recursively convert dictionary keys to unicode \"\"\"\n+    if isinstance(d, dict):\n+        return dict((unicode(k), unicode_dict(v)) for k, v in d.items())","path":"portality/util.py","position":16,"original_position":16,"commit_id":"1671de864374c2fbef84fa12890600d163a63657","original_commit_id":"1671de864374c2fbef84fa12890600d163a63657","user":{"login":"emanuil-tolev","id":1190172,"avatar_url":"https://avatars.githubusercontent.com/u/1190172?v=3","gravatar_id":"","url":"https://api.github.com/users/emanuil-tolev","html_url":"https://github.com/emanuil-tolev","followers_url":"https://api.github.com/users/emanuil-tolev/followers","following_url":"https://api.github.com/users/emanuil-tolev/following{/other_user}","gists_url":"https://api.github.com/users/emanuil-tolev/gists{/gist_id}","starred_url":"https://api.github.com/users/emanuil-tolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanuil-tolev/subscriptions","organizations_url":"https://api.github.com/users/emanuil-tolev/orgs","repos_url":"https://api.github.com/users/emanuil-tolev/repos","events_url":"https://api.github.com/users/emanuil-tolev/events{/privacy}","received_events_url":"https://api.github.com/users/emanuil-tolev/received_events","type":"User","site_admin":false},"body":"that's the spirit","created_at":"2016-02-29T16:07:47Z","updated_at":"2016-02-29T16:07:47Z","html_url":"https://github.com/DOAJ/doaj/pull/993#discussion_r54431622","pull_request_url":"https://api.github.com/repos/DOAJ/doaj/pulls/993","_links":{"self":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/comments/54431622"},"html":{"href":"https://github.com/DOAJ/doaj/pull/993#discussion_r54431622"},"pull_request":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/993"}}},"pull_request":{"url":"https://api.github.com/repos/DOAJ/doaj/pulls/993","id":61000468,"html_url":"https://github.com/DOAJ/doaj/pull/993","diff_url":"https://github.com/DOAJ/doaj/pull/993.diff","patch_url":"https://github.com/DOAJ/doaj/pull/993.patch","issue_url":"https://api.github.com/repos/DOAJ/doaj/issues/993","number":993,"state":"open","locked":false,"title":"Feature/iss941 article cleanup script","user":{"login":"Steven-Eardley","id":1446355,"avatar_url":"https://avatars.githubusercontent.com/u/1446355?v=3","gravatar_id":"","url":"https://api.github.com/users/Steven-Eardley","html_url":"https://github.com/Steven-Eardley","followers_url":"https://api.github.com/users/Steven-Eardley/followers","following_url":"https://api.github.com/users/Steven-Eardley/following{/other_user}","gists_url":"https://api.github.com/users/Steven-Eardley/gists{/gist_id}","starred_url":"https://api.github.com/users/Steven-Eardley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Steven-Eardley/subscriptions","organizations_url":"https://api.github.com/users/Steven-Eardley/orgs","repos_url":"https://api.github.com/users/Steven-Eardley/repos","events_url":"https://api.github.com/users/Steven-Eardley/events{/privacy}","received_events_url":"https://api.github.com/users/Steven-Eardley/received_events","type":"User","site_admin":false},"body":"## CAUTION - this contains migrations which edit all articles\r\n\r\nThis is a combination of code additions, refactors and new scripts / migrations.\r\n\r\n### Code changes:\r\n* fixed cause of #982, where article.add_journal_metadata() was adding duplicate subjects\r\n* refactor of article.py to separate the finding of related journal into its own function\r\n* added property to articles: ```journal_issn```, which is the journal's preferred ISSN\r\n* article.add_journal_metadata() now finds the ```journal_issn``` and can take a journal as an argument.\r\n* new function in ```util.py``` to normalise dictionary keys as unicode (to better compare them)\r\n\r\n### Migration:\r\n* new migration ```migrate/subjects/remove_duplicate_subjects.py``` - remove duplicate subjects #982.\r\n* documentation changes to existing migrations, and fixed a bug in ```upgrade.py```\r\n\r\n### Scripts\r\n* new script for regular use, ```/scripts/article_cleanup_sync.py```, which is a successor to the ```journalinfo``` script. This replaces and augments article's metadata by finding its associated journal, copying some properties, and (optionally) deleting those articles for which no journal could be found.\r\n\r\n### Esprit\r\n* requires new version which can handle bulk deletes.\r\n\r\n#941, #296, #964","created_at":"2016-02-28T18:12:14Z","updated_at":"2016-02-29T16:07:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"57ba814935e51fa28ad149cb95faa4471e55f316","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DOAJ/doaj/pulls/993/commits","review_comments_url":"https://api.github.com/repos/DOAJ/doaj/pulls/993/comments","review_comment_url":"https://api.github.com/repos/DOAJ/doaj/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DOAJ/doaj/issues/993/comments","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/1671de864374c2fbef84fa12890600d163a63657","head":{"label":"DOAJ:feature/iss941_article_cleanup_script","ref":"feature/iss941_article_cleanup_script","sha":"1671de864374c2fbef84fa12890600d163a63657","user":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"repo":{"id":14500626,"name":"doaj","full_name":"DOAJ/doaj","owner":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DOAJ/doaj","description":"The Directory of Open Access Journals - website and directory software","fork":false,"url":"https://api.github.com/repos/DOAJ/doaj","forks_url":"https://api.github.com/repos/DOAJ/doaj/forks","keys_url":"https://api.github.com/repos/DOAJ/doaj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DOAJ/doaj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DOAJ/doaj/teams","hooks_url":"https://api.github.com/repos/DOAJ/doaj/hooks","issue_events_url":"https://api.github.com/repos/DOAJ/doaj/issues/events{/number}","events_url":"https://api.github.com/repos/DOAJ/doaj/events","assignees_url":"https://api.github.com/repos/DOAJ/doaj/assignees{/user}","branches_url":"https://api.github.com/repos/DOAJ/doaj/branches{/branch}","tags_url":"https://api.github.com/repos/DOAJ/doaj/tags","blobs_url":"https://api.github.com/repos/DOAJ/doaj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DOAJ/doaj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DOAJ/doaj/git/refs{/sha}","trees_url":"https://api.github.com/repos/DOAJ/doaj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/{sha}","languages_url":"https://api.github.com/repos/DOAJ/doaj/languages","stargazers_url":"https://api.github.com/repos/DOAJ/doaj/stargazers","contributors_url":"https://api.github.com/repos/DOAJ/doaj/contributors","subscribers_url":"https://api.github.com/repos/DOAJ/doaj/subscribers","subscription_url":"https://api.github.com/repos/DOAJ/doaj/subscription","commits_url":"https://api.github.com/repos/DOAJ/doaj/commits{/sha}","git_commits_url":"https://api.github.com/repos/DOAJ/doaj/git/commits{/sha}","comments_url":"https://api.github.com/repos/DOAJ/doaj/comments{/number}","issue_comment_url":"https://api.github.com/repos/DOAJ/doaj/issues/comments{/number}","contents_url":"https://api.github.com/repos/DOAJ/doaj/contents/{+path}","compare_url":"https://api.github.com/repos/DOAJ/doaj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DOAJ/doaj/merges","archive_url":"https://api.github.com/repos/DOAJ/doaj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DOAJ/doaj/downloads","issues_url":"https://api.github.com/repos/DOAJ/doaj/issues{/number}","pulls_url":"https://api.github.com/repos/DOAJ/doaj/pulls{/number}","milestones_url":"https://api.github.com/repos/DOAJ/doaj/milestones{/number}","notifications_url":"https://api.github.com/repos/DOAJ/doaj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DOAJ/doaj/labels{/name}","releases_url":"https://api.github.com/repos/DOAJ/doaj/releases{/id}","deployments_url":"https://api.github.com/repos/DOAJ/doaj/deployments","created_at":"2013-11-18T18:07:31Z","updated_at":"2016-01-12T15:55:35Z","pushed_at":"2016-02-28T18:12:14Z","git_url":"git://github.com/DOAJ/doaj.git","ssh_url":"git@github.com:DOAJ/doaj.git","clone_url":"https://github.com/DOAJ/doaj.git","svn_url":"https://github.com/DOAJ/doaj","homepage":null,"size":6575,"stargazers_count":7,"watchers_count":7,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":151,"forks":3,"open_issues":151,"watchers":7,"default_branch":"develop"}},"base":{"label":"DOAJ:develop","ref":"develop","sha":"6fbc7a8aa3a0293d4552f6c39f2c5bdc7907dbbd","user":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"repo":{"id":14500626,"name":"doaj","full_name":"DOAJ/doaj","owner":{"login":"DOAJ","id":5971926,"avatar_url":"https://avatars.githubusercontent.com/u/5971926?v=3","gravatar_id":"","url":"https://api.github.com/users/DOAJ","html_url":"https://github.com/DOAJ","followers_url":"https://api.github.com/users/DOAJ/followers","following_url":"https://api.github.com/users/DOAJ/following{/other_user}","gists_url":"https://api.github.com/users/DOAJ/gists{/gist_id}","starred_url":"https://api.github.com/users/DOAJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DOAJ/subscriptions","organizations_url":"https://api.github.com/users/DOAJ/orgs","repos_url":"https://api.github.com/users/DOAJ/repos","events_url":"https://api.github.com/users/DOAJ/events{/privacy}","received_events_url":"https://api.github.com/users/DOAJ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DOAJ/doaj","description":"The Directory of Open Access Journals - website and directory software","fork":false,"url":"https://api.github.com/repos/DOAJ/doaj","forks_url":"https://api.github.com/repos/DOAJ/doaj/forks","keys_url":"https://api.github.com/repos/DOAJ/doaj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DOAJ/doaj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DOAJ/doaj/teams","hooks_url":"https://api.github.com/repos/DOAJ/doaj/hooks","issue_events_url":"https://api.github.com/repos/DOAJ/doaj/issues/events{/number}","events_url":"https://api.github.com/repos/DOAJ/doaj/events","assignees_url":"https://api.github.com/repos/DOAJ/doaj/assignees{/user}","branches_url":"https://api.github.com/repos/DOAJ/doaj/branches{/branch}","tags_url":"https://api.github.com/repos/DOAJ/doaj/tags","blobs_url":"https://api.github.com/repos/DOAJ/doaj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DOAJ/doaj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DOAJ/doaj/git/refs{/sha}","trees_url":"https://api.github.com/repos/DOAJ/doaj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DOAJ/doaj/statuses/{sha}","languages_url":"https://api.github.com/repos/DOAJ/doaj/languages","stargazers_url":"https://api.github.com/repos/DOAJ/doaj/stargazers","contributors_url":"https://api.github.com/repos/DOAJ/doaj/contributors","subscribers_url":"https://api.github.com/repos/DOAJ/doaj/subscribers","subscription_url":"https://api.github.com/repos/DOAJ/doaj/subscription","commits_url":"https://api.github.com/repos/DOAJ/doaj/commits{/sha}","git_commits_url":"https://api.github.com/repos/DOAJ/doaj/git/commits{/sha}","comments_url":"https://api.github.com/repos/DOAJ/doaj/comments{/number}","issue_comment_url":"https://api.github.com/repos/DOAJ/doaj/issues/comments{/number}","contents_url":"https://api.github.com/repos/DOAJ/doaj/contents/{+path}","compare_url":"https://api.github.com/repos/DOAJ/doaj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DOAJ/doaj/merges","archive_url":"https://api.github.com/repos/DOAJ/doaj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DOAJ/doaj/downloads","issues_url":"https://api.github.com/repos/DOAJ/doaj/issues{/number}","pulls_url":"https://api.github.com/repos/DOAJ/doaj/pulls{/number}","milestones_url":"https://api.github.com/repos/DOAJ/doaj/milestones{/number}","notifications_url":"https://api.github.com/repos/DOAJ/doaj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DOAJ/doaj/labels{/name}","releases_url":"https://api.github.com/repos/DOAJ/doaj/releases{/id}","deployments_url":"https://api.github.com/repos/DOAJ/doaj/deployments","created_at":"2013-11-18T18:07:31Z","updated_at":"2016-01-12T15:55:35Z","pushed_at":"2016-02-28T18:12:14Z","git_url":"git://github.com/DOAJ/doaj.git","ssh_url":"git@github.com:DOAJ/doaj.git","clone_url":"https://github.com/DOAJ/doaj.git","svn_url":"https://github.com/DOAJ/doaj","homepage":null,"size":6575,"stargazers_count":7,"watchers_count":7,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":151,"forks":3,"open_issues":151,"watchers":7,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/993"},"html":{"href":"https://github.com/DOAJ/doaj/pull/993"},"issue":{"href":"https://api.github.com/repos/DOAJ/doaj/issues/993"},"comments":{"href":"https://api.github.com/repos/DOAJ/doaj/issues/993/comments"},"review_comments":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/993/comments"},"review_comment":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DOAJ/doaj/pulls/993/commits"},"statuses":{"href":"https://api.github.com/repos/DOAJ/doaj/statuses/1671de864374c2fbef84fa12890600d163a63657"}}}}