{"action":"created","comment":{"url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/comments/43605009","id":43605009,"diff_hunk":"@@ -0,0 +1,74 @@\n+# -*- coding: utf-8 -*-\n+#\n+# This file is part of Invenio.\n+# Copyright (C) 2015 CERN.\n+#\n+# Invenio is free software; you can redistribute it\n+# and/or modify it under the terms of the GNU General Public License as\n+# published by the Free Software Foundation; either version 2 of the\n+# License, or (at your option) any later version.\n+#\n+# Invenio is distributed in the hope that it will be\n+# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+# General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with Invenio; if not, write to the\n+# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,\n+# MA 02111-1307, USA.\n+#\n+# In applying this license, CERN does not\n+# waive the privileges and immunities granted to it by virtue of its status\n+# as an Intergovernmental Organization or submit itself to any jurisdiction.\n+\n+\"\"\"Database models for user profiles.\"\"\"\n+\n+from __future__ import absolute_import, print_function\n+\n+from invenio_accounts.models import User\n+\n+from invenio_db import db\n+\n+from sqlalchemy.orm import validates\n+\n+from .validators import validate_username\n+\n+\n+class AnonymousUserProfile():\n+\n+    \"\"\"Anonymous user profile.\"\"\"\n+\n+    def is_anonymous(self):\n+        \"\"\"Return whether this UserProfile is anonymous.\"\"\"\n+        return True\n+\n+\n+class UserProfile(db.Model):\n+\n+    \"\"\"UserProfile model.\n+\n+    UserProfiles store information about account users.\n+    \"\"\"\n+\n+    __tablename__ = 'userprofile_userprofile'\n+\n+    id = db.Column(db.Integer, primary_key=True)\n+\n+    user_id = db.Column(db.Integer, db.ForeignKey(User.id))\n+\n+    username = db.Column(db.String(255), unique=True)\n+\n+    first_name = db.Column(db.String(255))\n+\n+    last_name = db.Column(db.String(255))","path":"invenio_userprofile/models.py","position":64,"original_position":64,"commit_id":"bc222f319c0527f2e15071a6b875312c634efb99","original_commit_id":"bc222f319c0527f2e15071a6b875312c634efb99","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":"Hi! `first_name`, `last_name` is minefield in our international environment. What about simply: `preferred_name` or `fullname`?","created_at":"2015-11-02T08:26:03Z","updated_at":"2015-11-02T08:26:03Z","html_url":"https://github.com/inveniosoftware/invenio-userprofile/pull/1#discussion_r43605009","pull_request_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/comments/43605009"},"html":{"href":"https://github.com/inveniosoftware/invenio-userprofile/pull/1#discussion_r43605009"},"pull_request":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/1","id":48766262,"html_url":"https://github.com/inveniosoftware/invenio-userprofile/pull/1","diff_url":"https://github.com/inveniosoftware/invenio-userprofile/pull/1.diff","patch_url":"https://github.com/inveniosoftware/invenio-userprofile/pull/1.patch","issue_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/issues/1","number":1,"state":"open","locked":false,"title":"WIP userprofile: initial commit","user":{"login":"SamiHiltunen","id":3035183,"avatar_url":"https://avatars.githubusercontent.com/u/3035183?v=3","gravatar_id":"","url":"https://api.github.com/users/SamiHiltunen","html_url":"https://github.com/SamiHiltunen","followers_url":"https://api.github.com/users/SamiHiltunen/followers","following_url":"https://api.github.com/users/SamiHiltunen/following{/other_user}","gists_url":"https://api.github.com/users/SamiHiltunen/gists{/gist_id}","starred_url":"https://api.github.com/users/SamiHiltunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamiHiltunen/subscriptions","organizations_url":"https://api.github.com/users/SamiHiltunen/orgs","repos_url":"https://api.github.com/users/SamiHiltunen/repos","events_url":"https://api.github.com/users/SamiHiltunen/events{/privacy}","received_events_url":"https://api.github.com/users/SamiHiltunen/received_events","type":"User","site_admin":false},"body":"* Initial commit for Invenio-UserProfile.\r\n\r\nSigned-off-by: Sami Hiltunen <sami.mikael.hiltunen@cern.ch>\r\n\r\nStill work in progress","created_at":"2015-10-26T16:55:30Z","updated_at":"2015-11-02T08:26:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f286e9da110c157dc63977a8094ebb9fc7cbfbb3","assignee":{"login":"SamiHiltunen","id":3035183,"avatar_url":"https://avatars.githubusercontent.com/u/3035183?v=3","gravatar_id":"","url":"https://api.github.com/users/SamiHiltunen","html_url":"https://github.com/SamiHiltunen","followers_url":"https://api.github.com/users/SamiHiltunen/followers","following_url":"https://api.github.com/users/SamiHiltunen/following{/other_user}","gists_url":"https://api.github.com/users/SamiHiltunen/gists{/gist_id}","starred_url":"https://api.github.com/users/SamiHiltunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamiHiltunen/subscriptions","organizations_url":"https://api.github.com/users/SamiHiltunen/orgs","repos_url":"https://api.github.com/users/SamiHiltunen/repos","events_url":"https://api.github.com/users/SamiHiltunen/events{/privacy}","received_events_url":"https://api.github.com/users/SamiHiltunen/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/milestones/1","html_url":"https://github.com/inveniosoftware/invenio-userprofile/milestones/v1.0.0","labels_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/milestones/1/labels","id":1377726,"number":1,"title":"v1.0.0","description":"","creator":{"login":"lnielsen","id":1698163,"avatar_url":"https://avatars.githubusercontent.com/u/1698163?v=3","gravatar_id":"","url":"https://api.github.com/users/lnielsen","html_url":"https://github.com/lnielsen","followers_url":"https://api.github.com/users/lnielsen/followers","following_url":"https://api.github.com/users/lnielsen/following{/other_user}","gists_url":"https://api.github.com/users/lnielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/lnielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnielsen/subscriptions","organizations_url":"https://api.github.com/users/lnielsen/orgs","repos_url":"https://api.github.com/users/lnielsen/repos","events_url":"https://api.github.com/users/lnielsen/events{/privacy}","received_events_url":"https://api.github.com/users/lnielsen/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-10-26T17:36:17Z","updated_at":"2015-10-26T17:36:31Z","due_on":"2015-11-29T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/1/commits","review_comments_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/1/comments","review_comment_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/issues/1/comments","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/statuses/bc222f319c0527f2e15071a6b875312c634efb99","head":{"label":"SamiHiltunen:module-bootstrap","ref":"module-bootstrap","sha":"bc222f319c0527f2e15071a6b875312c634efb99","user":{"login":"SamiHiltunen","id":3035183,"avatar_url":"https://avatars.githubusercontent.com/u/3035183?v=3","gravatar_id":"","url":"https://api.github.com/users/SamiHiltunen","html_url":"https://github.com/SamiHiltunen","followers_url":"https://api.github.com/users/SamiHiltunen/followers","following_url":"https://api.github.com/users/SamiHiltunen/following{/other_user}","gists_url":"https://api.github.com/users/SamiHiltunen/gists{/gist_id}","starred_url":"https://api.github.com/users/SamiHiltunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamiHiltunen/subscriptions","organizations_url":"https://api.github.com/users/SamiHiltunen/orgs","repos_url":"https://api.github.com/users/SamiHiltunen/repos","events_url":"https://api.github.com/users/SamiHiltunen/events{/privacy}","received_events_url":"https://api.github.com/users/SamiHiltunen/received_events","type":"User","site_admin":false},"repo":{"id":44614095,"name":"invenio-userprofile","full_name":"SamiHiltunen/invenio-userprofile","owner":{"login":"SamiHiltunen","id":3035183,"avatar_url":"https://avatars.githubusercontent.com/u/3035183?v=3","gravatar_id":"","url":"https://api.github.com/users/SamiHiltunen","html_url":"https://github.com/SamiHiltunen","followers_url":"https://api.github.com/users/SamiHiltunen/followers","following_url":"https://api.github.com/users/SamiHiltunen/following{/other_user}","gists_url":"https://api.github.com/users/SamiHiltunen/gists{/gist_id}","starred_url":"https://api.github.com/users/SamiHiltunen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamiHiltunen/subscriptions","organizations_url":"https://api.github.com/users/SamiHiltunen/orgs","repos_url":"https://api.github.com/users/SamiHiltunen/repos","events_url":"https://api.github.com/users/SamiHiltunen/events{/privacy}","received_events_url":"https://api.github.com/users/SamiHiltunen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SamiHiltunen/invenio-userprofile","description":"","fork":true,"url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile","forks_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/forks","keys_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/teams","hooks_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/hooks","issue_events_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/issues/events{/number}","events_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/events","assignees_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/assignees{/user}","branches_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/branches{/branch}","tags_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/tags","blobs_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/git/refs{/sha}","trees_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/statuses/{sha}","languages_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/languages","stargazers_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/stargazers","contributors_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/contributors","subscribers_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/subscribers","subscription_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/subscription","commits_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/commits{/sha}","git_commits_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/git/commits{/sha}","comments_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/comments{/number}","issue_comment_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/issues/comments{/number}","contents_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/contents/{+path}","compare_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/merges","archive_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/downloads","issues_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/issues{/number}","pulls_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/pulls{/number}","milestones_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/milestones{/number}","notifications_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/labels{/name}","releases_url":"https://api.github.com/repos/SamiHiltunen/invenio-userprofile/releases{/id}","created_at":"2015-10-20T15:01:32Z","updated_at":"2015-10-20T15:01:04Z","pushed_at":"2015-10-28T13:01:35Z","git_url":"git://github.com/SamiHiltunen/invenio-userprofile.git","ssh_url":"git@github.com:SamiHiltunen/invenio-userprofile.git","clone_url":"https://github.com/SamiHiltunen/invenio-userprofile.git","svn_url":"https://github.com/SamiHiltunen/invenio-userprofile","homepage":null,"size":116,"stargazers_count":0,"watchers_count":0,"language":null,"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":"inveniosoftware:master","ref":"master","sha":"5f16787c62f452613a8b8ef2a0336c3e7d3706b0","user":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":44614073,"name":"invenio-userprofile","full_name":"inveniosoftware/invenio-userprofile","owner":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inveniosoftware/invenio-userprofile","description":"","fork":false,"url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile","forks_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/forks","keys_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/teams","hooks_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/hooks","issue_events_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/issues/events{/number}","events_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/events","assignees_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/assignees{/user}","branches_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/branches{/branch}","tags_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/tags","blobs_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/git/refs{/sha}","trees_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/statuses/{sha}","languages_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/languages","stargazers_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/stargazers","contributors_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/contributors","subscribers_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/subscribers","subscription_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/subscription","commits_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/commits{/sha}","git_commits_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/git/commits{/sha}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/comments{/number}","issue_comment_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/issues/comments{/number}","contents_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/contents/{+path}","compare_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/merges","archive_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/downloads","issues_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/issues{/number}","pulls_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls{/number}","milestones_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/milestones{/number}","notifications_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/labels{/name}","releases_url":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/releases{/id}","created_at":"2015-10-20T15:01:04Z","updated_at":"2015-10-20T15:01:04Z","pushed_at":"2015-10-28T13:01:35Z","git_url":"git://github.com/inveniosoftware/invenio-userprofile.git","ssh_url":"git@github.com:inveniosoftware/invenio-userprofile.git","clone_url":"https://github.com/inveniosoftware/invenio-userprofile.git","svn_url":"https://github.com/inveniosoftware/invenio-userprofile","homepage":null,"size":200,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/1"},"html":{"href":"https://github.com/inveniosoftware/invenio-userprofile/pull/1"},"issue":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/issues/1"},"comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/inveniosoftware/invenio-userprofile/statuses/bc222f319c0527f2e15071a6b875312c634efb99"}}}}