{"action":"created","comment":{"url":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/comments/194496578","pull_request_review_id":127680067,"id":194496578,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDQ5NjU3OA==","diff_hunk":"@@ -0,0 +1,287 @@\n+\"\"\"\n+Investment project SPI report functions.\n+\n+Service Performance Indicator report should have following metrics:\n+\n+SPI1_START  - investment project created on date\n+SPI1_END    - earliest one of 8 SPI interactions\n+SPI2_START  - earliest one of 2 SPI interactions that starts SPI 2\n+SPI2_END    - when project manager was first assigned, only project managers from IST\n+SPI3        - formatted list of propositions, only created by IST\n+SPI5_START  - when project has been moved to won\n+SPI5_END    - earliest interaction when aftercare was offered, only for new investor,\n+              only for IST managed projects\n+\"\"\"\n+\n+from functools import lru_cache\n+\n+from datahub.admin_report.csv import csv_iterator\n+from datahub.admin_report.report import Report\n+from datahub.core.constants import InvestmentProjectStage as Stage, Service\n+from datahub.interaction.models import (\n+    Interaction\n+)\n+from datahub.investment.constants import InvestorType\n+from datahub.investment.models import InvestmentProject\n+from datahub.investment.report.models import SPIReportConfiguration\n+\n+\n+@lru_cache(maxsize=None)\n+def get_after_care_offered_service_id():\n+    \"\"\"Get aftercare offered interaction service id.\"\"\"\n+    config = SPIReportConfiguration.objects.first()\n+    return str(config.aftercare_offered_id) if config else None\n+\n+\n+def format_date(d):\n+    \"\"\"Date format used in the report.\"\"\"\n+    return d.isoformat()\n+\n+\n+def write_report(file):\n+    \"\"\"Write CSV report.\"\"\"\n+    spi_report = SPIReport()\n+    for line in csv_iterator(spi_report):\n+        file.write(str(line))\n+\n+\n+class SPIReport(Report):\n+    \"\"\"SPI Report.\"\"\"\n+\n+    id = 'spi-report'\n+    name = 'SPIReport'\n+\n+    _required_attrs = (\n+        'id',\n+        'name',\n+        'field_titles',\n+    )\n+\n+    SPI1_START = 'Project created on'\n+    SPI1_END = 'Enquiry processed'\n+    SPI2_START = 'Assigned to IST'\n+    SPI2_END = 'Project manager assigned'\n+    SPI3 = 'Propositions'\n+    SPI5_START = 'Project moved to won'\n+    SPI5_END = 'Aftercare offered on'\n+\n+    SPI_PROJECT_ID = 'Project ID'\n+    SPI_DH_ID = 'Data Hub ID'\n+    SPI_NAME = 'Project name'\n+\n+    field_titles = {\n+        SPI_DH_ID: SPI_DH_ID,\n+        SPI_PROJECT_ID: SPI_PROJECT_ID,\n+        SPI_NAME: SPI_NAME,\n+        SPI1_START: SPI1_START,\n+        SPI1_END: SPI1_END,\n+        SPI2_START: SPI2_START,\n+        SPI2_END: SPI2_END,\n+        SPI5_START: SPI5_START,\n+        SPI5_END: SPI5_END,\n+        SPI3: SPI3,\n+    }\n+\n+    SPI1_END_SERVICE_IDS = {\n+        Service.requested_more_information.value.id,\n+        Service.confirmed_prospect.value.id,\n+        Service.assigned_to_ist_cmc.value.id,\n+        Service.assigned_to_ist_sas.value.id,\n+        Service.assigned_to_hq.value.id,\n+        Service.transferred_to_lep.value.id,\n+        Service.transferred_to_da.value.id,\n+        Service.transferred_to_lp.value.id,\n+    }\n+\n+    SPI2_START_SERVICE_IDS = {\n+        Service.assigned_to_ist_cmc.value.id,\n+        Service.assigned_to_ist_sas.value.id,\n+    }\n+\n+    spi5_end_service_ids = None\n+    mappings = None\n+\n+    def __init__(self, *args, **kwargs):\n+        \"\"\"Initialise the report.\"\"\"\n+        super().__init__(*args, **kwargs)\n+        self.spi5_end_service_ids = {\n+            get_after_care_offered_service_id()\n+        }\n+        self.mappings = (\n+            (self.SPI1_END_SERVICE_IDS, self.SPI1_END),\n+            (self.SPI2_START_SERVICE_IDS, self.SPI2_START),\n+            (self.spi5_end_service_ids, self.SPI5_END),\n+        )\n+\n+    def _get_spi_interactions(self, investment_project):\n+        \"\"\"\n+        Gets SPI interactions for given Investment Project.\n+\n+        Takes earliest interaction for each SPI, if available.\n+        \"\"\"\n+        service_ids = (\n+            self.SPI1_END_SERVICE_IDS\n+            | self.SPI2_START_SERVICE_IDS\n+            | self.spi5_end_service_ids\n+        )\n+\n+        interactions = Interaction.objects.filter(\n+            investment_project_id=investment_project.id,\n+            service_id__in=service_ids,\n+        ).order_by('created_on')\n+\n+        data = {}\n+        for interaction in interactions:\n+            for mapping in self.mappings:\n+                if (\n+                    str(interaction.service_id) in mapping[0]\n+                    and mapping[1] not in data\n+                ):\n+                    data[mapping[1]] = format_date(interaction.created_on)\n+\n+        return data\n+\n+    def _has_ist_project_manager(self, investment_project):\n+        \"\"\"Checks if investment project has an IST project manager.\"\"\"\n+        project_manager = investment_project.project_manager\n+        return (\n+            project_manager\n+            and project_manager.dit_team\n+            and 'IST' in project_manager.dit_team.name\n+        )\n+\n+    def _find_when_project_moved_to_won(self, investment_project):\n+        \"\"\"\n+        Finds when project has been moved to Won stage.\n+\n+        Earliest date counts.\n+        \"\"\"\n+        stage_log = investment_project.stage_log.filter(\n+            stage_id=Stage.won.value.id\n+        ).order_by('created_on').first()\n+\n+        return stage_log.created_on if stage_log else None\n+\n+    def _get_propositions(self, investment_project, ist_only=False):\n+        \"\"\"Gets project's propositions.\"\"\"\n+        qs = investment_project.proposition.select_related(\n+            'adviser',\n+            'created_by__dit_team'\n+        )\n+        if ist_only:\n+            # Only IST teams have IST in their name\n+            qs = qs.filter(created_by__dit_team__name__contains='IST')\n+        return qs.order_by('created_on')\n+\n+    def _format_propositions(self, propositions):\n+        \"\"\"\n+        Formats propositions.\n+\n+        Propositions need to be presented in the cell in following format:\n+\n+        deadline;ongoing;;adviser.name;deadline;completed;modified_on;adviser.name...\n+        \"\"\"\n+        formatted = []\n+\n+        for proposition in propositions:\n+            formatted.append(proposition.deadline.isoformat())\n+            formatted.append(proposition.status)\n+            if proposition.status == 'ongoing':\n+                formatted.append('')\n+            else:\n+                formatted.append(proposition.modified_on.isoformat())\n+            formatted.append(proposition.adviser.name)\n+\n+        return ';'.join(formatted)\n+\n+    def _enrich_row(self, investment_project, spi_data=None):\n+        \"\"\"Enriches the spi report with investment project details.\"\"\"\n+        if spi_data is None:\n+            spi_data = {}\n+\n+        spi_data[self.SPI_DH_ID] = str(investment_project.id)\n+        spi_data[self.SPI_PROJECT_ID] = investment_project.project_code\n+        spi_data[self.SPI_NAME] = investment_project.name\n+        return spi_data\n+\n+    def get_spi1(self, investment_project, spi_interaction_dates, data=None):\n+        \"\"\"Update data with SPI 1 dates.\"\"\"\n+        if data is None:\n+            data = {}\n+\n+        data[self.SPI1_START] = format_date(investment_project.created_on)\n+        if self.SPI1_END in spi_interaction_dates:\n+            data[self.SPI1_END] = spi_interaction_dates[self.SPI1_END]\n+\n+        return data\n+\n+    def get_spi2(self, investment_project, spi_interaction_dates, data=None):\n+        \"\"\"Update data with SPI 2 dates.\"\"\"\n+        if data is None:\n+            data = {}\n+\n+        has_ist_pm = self._has_ist_project_manager(investment_project)\n+\n+        if self.SPI2_START in spi_interaction_dates:\n+            data[self.SPI2_START] = spi_interaction_dates[self.SPI2_START]\n+\n+        if has_ist_pm and investment_project.project_manager_first_assigned_on:\n+            data[self.SPI2_END] = format_date(investment_project.project_manager_first_assigned_on)\n+\n+        return data\n+\n+    def get_spi3(self, investment_project, data=None):\n+        \"\"\"Update data with SPI 3 propositions.\"\"\"\n+        if data is None:\n+            data = {}\n+\n+        propositions = self._get_propositions(investment_project, ist_only=True)\n+        if propositions:\n+            data[self.SPI3] = self._format_propositions(propositions)\n+\n+        return data\n+\n+    def get_spi5(self, investment_project, spi_interaction_dates, data=None):\n+        \"\"\"Update data with SPI 5 dates.\"\"\"\n+        if data is None:\n+            data = {}\n+\n+        has_ist_pm = self._has_ist_project_manager(investment_project)\n+        new_investor_id = InvestorType.new_investor.value.id\n+        is_new_investor = str(investment_project.investor_type_id) == new_investor_id\n+\n+        if has_ist_pm and is_new_investor:\n+            moved_to_won = self._find_when_project_moved_to_won(investment_project)\n+            if moved_to_won:\n+                data[self.SPI5_START] = format_date(moved_to_won)\n+\n+            if self.SPI5_END in spi_interaction_dates:\n+                data[self.SPI5_END] = spi_interaction_dates[self.SPI5_END]\n+\n+        return data\n+\n+    def get_spi_data_for_investment_project(self, investment_project):\n+        \"\"\"Gets all SPI data for investment project.\"\"\"\n+        spi_interaction_dates = self._get_spi_interactions(investment_project)\n+\n+        data = self.get_spi1(investment_project, spi_interaction_dates)\n+        data = self.get_spi2(investment_project, spi_interaction_dates, data)\n+        data = self.get_spi3(investment_project, data)\n+        data = self.get_spi5(investment_project, spi_interaction_dates, data)","path":"datahub/investment/report/spi.py","position":null,"original_position":270,"commit_id":"8cd34feeb00b93b3dc0307a677ed60828b260516","original_commit_id":"c841ed9ce12f1b21be79fa11f765d2cab568903f","user":{"login":"elcct","id":5889630,"node_id":"MDQ6VXNlcjU4ODk2MzA=","avatar_url":"https://avatars2.githubusercontent.com/u/5889630?v=4","gravatar_id":"","url":"https://api.github.com/users/elcct","html_url":"https://github.com/elcct","followers_url":"https://api.github.com/users/elcct/followers","following_url":"https://api.github.com/users/elcct/following{/other_user}","gists_url":"https://api.github.com/users/elcct/gists{/gist_id}","starred_url":"https://api.github.com/users/elcct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elcct/subscriptions","organizations_url":"https://api.github.com/users/elcct/orgs","repos_url":"https://api.github.com/users/elcct/repos","events_url":"https://api.github.com/users/elcct/events{/privacy}","received_events_url":"https://api.github.com/users/elcct/received_events","type":"User","site_admin":false},"body":"Good idea. It wasn't very useful the way it was. Fixed. Thanks.","created_at":"2018-06-11T18:10:37Z","updated_at":"2018-06-11T18:10:37Z","html_url":"https://github.com/uktrade/data-hub-leeloo/pull/973#discussion_r194496578","pull_request_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/973","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/comments/194496578"},"html":{"href":"https://github.com/uktrade/data-hub-leeloo/pull/973#discussion_r194496578"},"pull_request":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/973"}},"in_reply_to_id":193425983},"pull_request":{"url":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/973","id":192743749,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNzQzNzQ5","html_url":"https://github.com/uktrade/data-hub-leeloo/pull/973","diff_url":"https://github.com/uktrade/data-hub-leeloo/pull/973.diff","patch_url":"https://github.com/uktrade/data-hub-leeloo/pull/973.patch","issue_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues/973","number":973,"state":"open","locked":false,"title":"Investment SPI Report","user":{"login":"elcct","id":5889630,"node_id":"MDQ6VXNlcjU4ODk2MzA=","avatar_url":"https://avatars2.githubusercontent.com/u/5889630?v=4","gravatar_id":"","url":"https://api.github.com/users/elcct","html_url":"https://github.com/elcct","followers_url":"https://api.github.com/users/elcct/followers","following_url":"https://api.github.com/users/elcct/following{/other_user}","gists_url":"https://api.github.com/users/elcct/gists{/gist_id}","starred_url":"https://api.github.com/users/elcct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elcct/subscriptions","organizations_url":"https://api.github.com/users/elcct/orgs","repos_url":"https://api.github.com/users/elcct/repos","events_url":"https://api.github.com/users/elcct/events{/privacy}","received_events_url":"https://api.github.com/users/elcct/received_events","type":"User","site_admin":false},"body":"Issue number: DHI-13\r\n\r\n### Description of change\r\n\r\nThis one provides functionality to once a day automatically generate SPI Report and uploads it to S3, which can be downloaded from Django admin, by anyone having access to it.\r\n\r\nThe report is a CSV file that contains 4 SPI metrics along with basic investment project details.\r\n\r\nSPI 1\r\n  - investment project created on date\r\n  - earliest one of 8 SPI interactions\r\n\r\nSPI 2\r\n  - earliest one of 2 SPI interactions that start SPI 2\r\n  - when project manager was first assigned (only IST project managers)\r\n\r\nSPI 3\r\n  - formatted list of propositions, only created by IST\r\n\r\nSPI 5\r\n  - when project has been moved to won\r\n  - earliest interaction when aftercare was offered, only for new investor, only for IST managed projects\r\n\r\nThis contains work from removed commit to restrict who can move investment project from Active to Verify Win and from Verify Win to Won.\r\n\r\nIST team is determined if the team name contains \"IST\" - that seems to be enough.\r\n\r\nThere is Report Configuration model, that contains reference to the Service type that ends SPI 5, as we haven't got that added programmatically.\r\n\r\nIt uses its own credentials to access S3 as the bucket uses different key and secret that the document's one.\r\n\r\nThere is also additional environment variable that can enable report generation.\r\n\r\n### Checklist\r\n\r\n* [ ] Have any relevant search models been updated?\r\n* [ ] Have any relevant fixtures (`fixtures/test_data.yaml`) been updated?\r\n* [ ] Have any relevant select-/prefetch-related field lists in the views and search apps been updated?\r\n* [X] Has the admin site been updated (for new models, fields etc.)?\r\n* [X] Has the README been updated (if needed)?\r\n","created_at":"2018-06-05T15:15:12Z","updated_at":"2018-06-11T18:10:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee8e81b144eb350f4e33b08584e463d1a34011de","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/973/commits","review_comments_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/973/comments","review_comment_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues/973/comments","statuses_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/statuses/8cd34feeb00b93b3dc0307a677ed60828b260516","head":{"label":"uktrade:feature/investment-spi-report","ref":"feature/investment-spi-report","sha":"8cd34feeb00b93b3dc0307a677ed60828b260516","user":{"login":"uktrade","id":15107524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTA3NTI0","avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"repo":{"id":73379434,"node_id":"MDEwOlJlcG9zaXRvcnk3MzM3OTQzNA==","name":"data-hub-leeloo","full_name":"uktrade/data-hub-leeloo","owner":{"login":"uktrade","id":15107524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTA3NTI0","avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uktrade/data-hub-leeloo","description":"Django API for Data Hub frontend","fork":false,"url":"https://api.github.com/repos/uktrade/data-hub-leeloo","forks_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/forks","keys_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/teams","hooks_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/hooks","issue_events_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues/events{/number}","events_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/events","assignees_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/assignees{/user}","branches_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/branches{/branch}","tags_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/tags","blobs_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/refs{/sha}","trees_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/statuses/{sha}","languages_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/languages","stargazers_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/stargazers","contributors_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/contributors","subscribers_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/subscribers","subscription_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/subscription","commits_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/commits{/sha}","git_commits_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/commits{/sha}","comments_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/comments{/number}","issue_comment_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues/comments{/number}","contents_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/contents/{+path}","compare_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/merges","archive_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/downloads","issues_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues{/number}","pulls_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls{/number}","milestones_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/milestones{/number}","notifications_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/labels{/name}","releases_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/releases{/id}","deployments_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/deployments","created_at":"2016-11-10T12:21:01Z","updated_at":"2018-06-11T12:59:26Z","pushed_at":"2018-06-11T17:58:25Z","git_url":"git://github.com/uktrade/data-hub-leeloo.git","ssh_url":"git@github.com:uktrade/data-hub-leeloo.git","clone_url":"https://github.com/uktrade/data-hub-leeloo.git","svn_url":"https://github.com/uktrade/data-hub-leeloo","homepage":null,"size":5151,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":0,"open_issues":10,"watchers":1,"default_branch":"develop"}},"base":{"label":"uktrade:develop","ref":"develop","sha":"be3b40f8a772f1c1c79d7f761af10173db766de7","user":{"login":"uktrade","id":15107524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTA3NTI0","avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"repo":{"id":73379434,"node_id":"MDEwOlJlcG9zaXRvcnk3MzM3OTQzNA==","name":"data-hub-leeloo","full_name":"uktrade/data-hub-leeloo","owner":{"login":"uktrade","id":15107524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTA3NTI0","avatar_url":"https://avatars2.githubusercontent.com/u/15107524?v=4","gravatar_id":"","url":"https://api.github.com/users/uktrade","html_url":"https://github.com/uktrade","followers_url":"https://api.github.com/users/uktrade/followers","following_url":"https://api.github.com/users/uktrade/following{/other_user}","gists_url":"https://api.github.com/users/uktrade/gists{/gist_id}","starred_url":"https://api.github.com/users/uktrade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uktrade/subscriptions","organizations_url":"https://api.github.com/users/uktrade/orgs","repos_url":"https://api.github.com/users/uktrade/repos","events_url":"https://api.github.com/users/uktrade/events{/privacy}","received_events_url":"https://api.github.com/users/uktrade/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uktrade/data-hub-leeloo","description":"Django API for Data Hub frontend","fork":false,"url":"https://api.github.com/repos/uktrade/data-hub-leeloo","forks_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/forks","keys_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/teams","hooks_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/hooks","issue_events_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues/events{/number}","events_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/events","assignees_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/assignees{/user}","branches_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/branches{/branch}","tags_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/tags","blobs_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/refs{/sha}","trees_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/statuses/{sha}","languages_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/languages","stargazers_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/stargazers","contributors_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/contributors","subscribers_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/subscribers","subscription_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/subscription","commits_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/commits{/sha}","git_commits_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/git/commits{/sha}","comments_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/comments{/number}","issue_comment_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues/comments{/number}","contents_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/contents/{+path}","compare_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/merges","archive_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/downloads","issues_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues{/number}","pulls_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls{/number}","milestones_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/milestones{/number}","notifications_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/labels{/name}","releases_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/releases{/id}","deployments_url":"https://api.github.com/repos/uktrade/data-hub-leeloo/deployments","created_at":"2016-11-10T12:21:01Z","updated_at":"2018-06-11T12:59:26Z","pushed_at":"2018-06-11T17:58:25Z","git_url":"git://github.com/uktrade/data-hub-leeloo.git","ssh_url":"git@github.com:uktrade/data-hub-leeloo.git","clone_url":"https://github.com/uktrade/data-hub-leeloo.git","svn_url":"https://github.com/uktrade/data-hub-leeloo","homepage":null,"size":5151,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":0,"open_issues":10,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/973"},"html":{"href":"https://github.com/uktrade/data-hub-leeloo/pull/973"},"issue":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues/973"},"comments":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/issues/973/comments"},"review_comments":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/973/comments"},"review_comment":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/pulls/973/commits"},"statuses":{"href":"https://api.github.com/repos/uktrade/data-hub-leeloo/statuses/8cd34feeb00b93b3dc0307a677ed60828b260516"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"elcct"}}