{"action":"created","comment":{"url":"https://api.github.com/repos/praekelt/nurseconnect/pulls/comments/75304895","id":75304895,"diff_hunk":"@@ -0,0 +1,102 @@\n+from django.contrib.auth.hashers import make_password, check_password\n+from django.contrib.auth.models import User\n+from django.db import models\n+from django.db.models.signals import post_save\n+from django.dispatch import receiver\n+\n+from nurseconnect.constants import GENDERS\n+from molo.commenting.models import MoloComment\n+from wagtail.contrib.settings.models import BaseSetting\n+from wagtail.contrib.settings.registry import register_setting\n+from wagtail.wagtailadmin.edit_handlers import FieldPanel\n+\n+\n+class NurseConnectUserProfile(models.Model):\n+    user = models.OneToOneField(\n+        User,\n+        related_name=\"nurse_connect_profile\",\n+        primary_key=True\n+    )\n+    gender = models.CharField(\n+        max_length=1,\n+        choices=GENDERS,\n+        blank=True,\n+        null=True\n+    )\n+    mobile_number = models.CharField(\n+        max_length=15\n+    )\n+    staff_number = models.CharField(\n+        max_length=15\n+    )\n+    facility_code = models.CharField(\n+        max_length=15\n+    )\n+    security_question_1_answer = models.CharField(\n+        max_length=128,\n+        null=True\n+    )\n+    security_question_2_answer = models.CharField(\n+        max_length=128,\n+        null=True\n+    )\n+\n+    # based on django.contrib.auth.models.AbstractBaseUser set_password &\n+    # check_password functions (takes plain text, generates hash for database)\n+    def set_security_question_1_answer(self, raw_answer):\n+        self.security_question_1_answer = make_password(\n+            raw_answer.strip().lower()\n+        )\n+\n+    def set_security_question_2_answer(self, raw_answer):\n+        self.security_question_2_answer = make_password(\n+            raw_answer.strip().lower()\n+        )\n+\n+    def check_security_question_1_answer(self, raw_answer):\n+        def setter(raw_answer):","path":"nurseconnect/models.py","position":58,"original_position":57,"commit_id":"d69ca96974794335b1f74e7b7a00b25e6cccc8ee","original_commit_id":"17ff85e89185bc044ba25706560ff9867e9629cc","user":{"login":"AltusBarry","id":10414305,"avatar_url":"https://avatars.githubusercontent.com/u/10414305?v=3","gravatar_id":"","url":"https://api.github.com/users/AltusBarry","html_url":"https://github.com/AltusBarry","followers_url":"https://api.github.com/users/AltusBarry/followers","following_url":"https://api.github.com/users/AltusBarry/following{/other_user}","gists_url":"https://api.github.com/users/AltusBarry/gists{/gist_id}","starred_url":"https://api.github.com/users/AltusBarry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltusBarry/subscriptions","organizations_url":"https://api.github.com/users/AltusBarry/orgs","repos_url":"https://api.github.com/users/AltusBarry/repos","events_url":"https://api.github.com/users/AltusBarry/events{/privacy}","received_events_url":"https://api.github.com/users/AltusBarry/received_events","type":"User","site_admin":false},"body":"Make setter more generic as it is used by more than one method and move it out to be used by both.","created_at":"2016-08-18T13:14:25Z","updated_at":"2016-08-18T13:14:25Z","html_url":"https://github.com/praekelt/nurseconnect/pull/26#discussion_r75304895","pull_request_url":"https://api.github.com/repos/praekelt/nurseconnect/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/praekelt/nurseconnect/pulls/comments/75304895"},"html":{"href":"https://github.com/praekelt/nurseconnect/pull/26#discussion_r75304895"},"pull_request":{"href":"https://api.github.com/repos/praekelt/nurseconnect/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/praekelt/nurseconnect/pulls/26","id":81776452,"html_url":"https://github.com/praekelt/nurseconnect/pull/26","diff_url":"https://github.com/praekelt/nurseconnect/pull/26.diff","patch_url":"https://github.com/praekelt/nurseconnect/pull/26.patch","issue_url":"https://api.github.com/repos/praekelt/nurseconnect/issues/26","number":26,"state":"open","locked":false,"title":"Feature/nur 1 bed","user":{"login":"chrislombaard","id":5526819,"avatar_url":"https://avatars.githubusercontent.com/u/5526819?v=3","gravatar_id":"","url":"https://api.github.com/users/chrislombaard","html_url":"https://github.com/chrislombaard","followers_url":"https://api.github.com/users/chrislombaard/followers","following_url":"https://api.github.com/users/chrislombaard/following{/other_user}","gists_url":"https://api.github.com/users/chrislombaard/gists{/gist_id}","starred_url":"https://api.github.com/users/chrislombaard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrislombaard/subscriptions","organizations_url":"https://api.github.com/users/chrislombaard/orgs","repos_url":"https://api.github.com/users/chrislombaard/repos","events_url":"https://api.github.com/users/chrislombaard/events{/privacy}","received_events_url":"https://api.github.com/users/chrislombaard/received_events","type":"User","site_admin":false},"body":"Integrated most of the FED templates with the nurseconnect project. All but the inbox, comments, search results, profile page and home page before login. User profile models have been created, mostly setup, and the first steps to form implementation have been done. Still a bit of work to be done on the views, forms and models, but most template integration has been done. ","created_at":"2016-08-18T08:35:38Z","updated_at":"2016-08-18T13:14:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80aa079a4372ef0654f0daa060926fc8bfeec14b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/praekelt/nurseconnect/pulls/26/commits","review_comments_url":"https://api.github.com/repos/praekelt/nurseconnect/pulls/26/comments","review_comment_url":"https://api.github.com/repos/praekelt/nurseconnect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/praekelt/nurseconnect/issues/26/comments","statuses_url":"https://api.github.com/repos/praekelt/nurseconnect/statuses/d69ca96974794335b1f74e7b7a00b25e6cccc8ee","head":{"label":"praekelt:feature/NUR-1-BED","ref":"feature/NUR-1-BED","sha":"d69ca96974794335b1f74e7b7a00b25e6cccc8ee","user":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"repo":{"id":61537068,"name":"nurseconnect","full_name":"praekelt/nurseconnect","owner":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekelt/nurseconnect","description":"","fork":false,"url":"https://api.github.com/repos/praekelt/nurseconnect","forks_url":"https://api.github.com/repos/praekelt/nurseconnect/forks","keys_url":"https://api.github.com/repos/praekelt/nurseconnect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekelt/nurseconnect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekelt/nurseconnect/teams","hooks_url":"https://api.github.com/repos/praekelt/nurseconnect/hooks","issue_events_url":"https://api.github.com/repos/praekelt/nurseconnect/issues/events{/number}","events_url":"https://api.github.com/repos/praekelt/nurseconnect/events","assignees_url":"https://api.github.com/repos/praekelt/nurseconnect/assignees{/user}","branches_url":"https://api.github.com/repos/praekelt/nurseconnect/branches{/branch}","tags_url":"https://api.github.com/repos/praekelt/nurseconnect/tags","blobs_url":"https://api.github.com/repos/praekelt/nurseconnect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekelt/nurseconnect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekelt/nurseconnect/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekelt/nurseconnect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekelt/nurseconnect/statuses/{sha}","languages_url":"https://api.github.com/repos/praekelt/nurseconnect/languages","stargazers_url":"https://api.github.com/repos/praekelt/nurseconnect/stargazers","contributors_url":"https://api.github.com/repos/praekelt/nurseconnect/contributors","subscribers_url":"https://api.github.com/repos/praekelt/nurseconnect/subscribers","subscription_url":"https://api.github.com/repos/praekelt/nurseconnect/subscription","commits_url":"https://api.github.com/repos/praekelt/nurseconnect/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekelt/nurseconnect/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekelt/nurseconnect/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekelt/nurseconnect/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekelt/nurseconnect/contents/{+path}","compare_url":"https://api.github.com/repos/praekelt/nurseconnect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekelt/nurseconnect/merges","archive_url":"https://api.github.com/repos/praekelt/nurseconnect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekelt/nurseconnect/downloads","issues_url":"https://api.github.com/repos/praekelt/nurseconnect/issues{/number}","pulls_url":"https://api.github.com/repos/praekelt/nurseconnect/pulls{/number}","milestones_url":"https://api.github.com/repos/praekelt/nurseconnect/milestones{/number}","notifications_url":"https://api.github.com/repos/praekelt/nurseconnect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekelt/nurseconnect/labels{/name}","releases_url":"https://api.github.com/repos/praekelt/nurseconnect/releases{/id}","deployments_url":"https://api.github.com/repos/praekelt/nurseconnect/deployments","created_at":"2016-06-20T10:00:06Z","updated_at":"2016-08-10T14:59:29Z","pushed_at":"2016-08-18T13:05:55Z","git_url":"git://github.com/praekelt/nurseconnect.git","ssh_url":"git@github.com:praekelt/nurseconnect.git","clone_url":"https://github.com/praekelt/nurseconnect.git","svn_url":"https://github.com/praekelt/nurseconnect","homepage":null,"size":2314,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"praekelt:develop","ref":"develop","sha":"c4556800a86133e358b1835d89c655a0a422f5a6","user":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"repo":{"id":61537068,"name":"nurseconnect","full_name":"praekelt/nurseconnect","owner":{"login":"praekelt","id":81810,"avatar_url":"https://avatars.githubusercontent.com/u/81810?v=3","gravatar_id":"","url":"https://api.github.com/users/praekelt","html_url":"https://github.com/praekelt","followers_url":"https://api.github.com/users/praekelt/followers","following_url":"https://api.github.com/users/praekelt/following{/other_user}","gists_url":"https://api.github.com/users/praekelt/gists{/gist_id}","starred_url":"https://api.github.com/users/praekelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praekelt/subscriptions","organizations_url":"https://api.github.com/users/praekelt/orgs","repos_url":"https://api.github.com/users/praekelt/repos","events_url":"https://api.github.com/users/praekelt/events{/privacy}","received_events_url":"https://api.github.com/users/praekelt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/praekelt/nurseconnect","description":"","fork":false,"url":"https://api.github.com/repos/praekelt/nurseconnect","forks_url":"https://api.github.com/repos/praekelt/nurseconnect/forks","keys_url":"https://api.github.com/repos/praekelt/nurseconnect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/praekelt/nurseconnect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/praekelt/nurseconnect/teams","hooks_url":"https://api.github.com/repos/praekelt/nurseconnect/hooks","issue_events_url":"https://api.github.com/repos/praekelt/nurseconnect/issues/events{/number}","events_url":"https://api.github.com/repos/praekelt/nurseconnect/events","assignees_url":"https://api.github.com/repos/praekelt/nurseconnect/assignees{/user}","branches_url":"https://api.github.com/repos/praekelt/nurseconnect/branches{/branch}","tags_url":"https://api.github.com/repos/praekelt/nurseconnect/tags","blobs_url":"https://api.github.com/repos/praekelt/nurseconnect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/praekelt/nurseconnect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/praekelt/nurseconnect/git/refs{/sha}","trees_url":"https://api.github.com/repos/praekelt/nurseconnect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/praekelt/nurseconnect/statuses/{sha}","languages_url":"https://api.github.com/repos/praekelt/nurseconnect/languages","stargazers_url":"https://api.github.com/repos/praekelt/nurseconnect/stargazers","contributors_url":"https://api.github.com/repos/praekelt/nurseconnect/contributors","subscribers_url":"https://api.github.com/repos/praekelt/nurseconnect/subscribers","subscription_url":"https://api.github.com/repos/praekelt/nurseconnect/subscription","commits_url":"https://api.github.com/repos/praekelt/nurseconnect/commits{/sha}","git_commits_url":"https://api.github.com/repos/praekelt/nurseconnect/git/commits{/sha}","comments_url":"https://api.github.com/repos/praekelt/nurseconnect/comments{/number}","issue_comment_url":"https://api.github.com/repos/praekelt/nurseconnect/issues/comments{/number}","contents_url":"https://api.github.com/repos/praekelt/nurseconnect/contents/{+path}","compare_url":"https://api.github.com/repos/praekelt/nurseconnect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/praekelt/nurseconnect/merges","archive_url":"https://api.github.com/repos/praekelt/nurseconnect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/praekelt/nurseconnect/downloads","issues_url":"https://api.github.com/repos/praekelt/nurseconnect/issues{/number}","pulls_url":"https://api.github.com/repos/praekelt/nurseconnect/pulls{/number}","milestones_url":"https://api.github.com/repos/praekelt/nurseconnect/milestones{/number}","notifications_url":"https://api.github.com/repos/praekelt/nurseconnect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/praekelt/nurseconnect/labels{/name}","releases_url":"https://api.github.com/repos/praekelt/nurseconnect/releases{/id}","deployments_url":"https://api.github.com/repos/praekelt/nurseconnect/deployments","created_at":"2016-06-20T10:00:06Z","updated_at":"2016-08-10T14:59:29Z","pushed_at":"2016-08-18T13:05:55Z","git_url":"git://github.com/praekelt/nurseconnect.git","ssh_url":"git@github.com:praekelt/nurseconnect.git","clone_url":"https://github.com/praekelt/nurseconnect.git","svn_url":"https://github.com/praekelt/nurseconnect","homepage":null,"size":2314,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/praekelt/nurseconnect/pulls/26"},"html":{"href":"https://github.com/praekelt/nurseconnect/pull/26"},"issue":{"href":"https://api.github.com/repos/praekelt/nurseconnect/issues/26"},"comments":{"href":"https://api.github.com/repos/praekelt/nurseconnect/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/praekelt/nurseconnect/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/praekelt/nurseconnect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/praekelt/nurseconnect/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/praekelt/nurseconnect/statuses/d69ca96974794335b1f74e7b7a00b25e6cccc8ee"}}}}
{"actor":{"display_login":"AltusBarry"}}