diff --git a/opentech/apply/funds/management/commands/seed_concept_note.py b/opentech/apply/funds/management/commands/seed_concept_note.py index 19addd3e4e83259386b682d4a54677fa0a7f4b02..9cb8796873a50ffc17d3e7e0c6b332ee91a1c9ac 100644 --- a/opentech/apply/funds/management/commands/seed_concept_note.py +++ b/opentech/apply/funds/management/commands/seed_concept_note.py @@ -152,9 +152,8 @@ class Command(BaseCommand): def create_concept_review_form(self): data3 = [ - {"type": "text_markup", "value": "<h3>Conflicts of Interest and Confidentialit</h3>", "id": "4dc49d2f-a886-4244-b347-3614f8d1e399"}, - {"type": "rich_text", "value": {"field_label": "Conflict(s) of interest disclosure", "help_text": "", "required": "", "default_value": ""}, "id": "f16be0b3-ef02-4876-b056-8a84238b1a52"}, {"type": "recommendation", "value": {"field_label": "Do you think we should support this request?", "help_text": "", "info": None}, "id": "25d0d9b0-6e65-4fe3-906a-a1cd211def96"}, + {"type": "rich_text", "value": {"field_label": "Recommendation comments", "help_text": "", "required": "", "default_value": ""}, "id": "f16be0b3-ef02-4876-b056-8a84238b1a52"}, {"type": "score", "value": {"field_label": "Goals and principles", "help_text": "", "required": ""}, "id": "6dd8d5d2-09a5-4681-aebc-eb9ccd00395a"}, {"type": "score", "value": {"field_label": "Technical merit", "help_text": "", "required": ""}, "id": "52b1f53c-9656-4b0c-8b8b-a9c57869356d"}, {"type": "score", "value": {"field_label": "Reasonable and realistic", "help_text": "", "required": ""}, "id": "aedb27e7-6044-4e04-b2c7-358065c8fe5c"}, @@ -172,10 +171,11 @@ class Command(BaseCommand): {"type": "text_markup", "value": "<h3>A. Conflicts of Interest and Confidentialit</h3>", "id": "976386e1-3a66-490f-9e82-bfbe1f134cf2"}, {"type": "checkbox", "value": {"field_label": "I understand about confidentiality", "help_text": "", "default_value": ""}, "id": "65fb2c22-a0c5-4cde-94a7-feb27072bc3d"}, {"type": "dropdown", "value": {"field_label": "Do you have any conflicts of interest to report?", "help_text": "", "required": "", "choices": ["Yes", "No"]}, "id": "dd75ce49-e3c4-43da-b724-4cb8bb88dcf8"}, + {"type": "rich_text", "value": {"field_label": "Conflict(s) of interest disclosure", "help_text": "", "required": "", "default_value": ""}, "id": "9f7fe70b-97b5-4263-98ac-a45bf97b59d0"}, {"type": "text_markup", "value": "<h3>B. General thoughts</h3>", "id": "976386e1-3a66-490f-9e82-bfbe1f134cf2"}, {"type": "rich_text", "value": {"field_label": "1. Positive aspects", "help_text": "", "required": "", "default_value": ""}, "id": "e91ed603-61ad-483e-be7b-21716d05a3bd"}, {"type": "rich_text", "value": {"field_label": "2. Concerns", "help_text": "", "required": "", "default_value": ""}, "id": "821fb071-7db7-4cc1-ac3a-34b9eee40c94"}, - {"type": "rich_text", "value": {"field_label": "3. Items that must be ", "help_text": "", "required": "", "default_value": ""}, "id": "021624ac-6628-430d-ba86-e68fd518c87e"}, + {"type": "rich_text", "value": {"field_label": "3. Items that must be addressed", "help_text": "", "required": "", "default_value": ""}, "id": "021624ac-6628-430d-ba86-e68fd518c87e"}, {"type": "text_markup", "value": "<h3>C. Specific aspects</h3>", "id": "976386e1-3a66-490f-9e82-bfbe1f134cf2"}, {"type": "score", "value": {"field_label": "1. Project overview", "help_text": "", "required": ""}, "id": "9c5603d5-f897-42fa-8739-5935769c94bd"}, {"type": "score", "value": {"field_label": "2. Proposal objectives", "help_text": "", "required": ""}, "id": "6b748400-fad9-4b31-bb85-e3a53c99f4df"}, @@ -189,7 +189,7 @@ class Command(BaseCommand): {"type": "score", "value": {"field_label": "10. Qualifications", "help_text": "", "required": ""}, "id": "d3f5479c-68da-41d9-a266-130d383bab6b"}, {"type": "score", "value": {"field_label": "11. Evaluation", "help_text": "", "required": ""}, "id": "2a61c71a-74f6-4963-8850-9289e852f604"}, {"type": "text_markup", "value": "<h3>D. Rationale and appropriateness consideration</h3>", "id": "976386e1-3a66-490f-9e82-bfbe1f134cf2"}, - {"type": "score", "value": {"field_label": "Rationale and appropriateness ", "help_text": "", "required": ""}, "id": "0d1bf533-968c-44b9-bb30-d437ae039474"}, + {"type": "score", "value": {"field_label": "Rationale and appropriateness", "help_text": "", "required": ""}, "id": "0d1bf533-968c-44b9-bb30-d437ae039474"}, {"type": "text_markup", "value": "<h3>E. General recommendation</h3>", "id": "976386e1-3a66-490f-9e82-bfbe1f134cf2"}, {"type": "recommendation", "value": {"field_label": "Recommendation", "help_text": "", "info": None}, "id": "4bf80578-1c8f-4515-9d6a-e52e87629e3e"}, {"type": "comments", "value": {"field_label": "Recommendation comments", "help_text": "", "info": None}, "id": "a814d7ac-8291-4f3e-b733-4a9a4f1f8a49"} diff --git a/opentech/apply/funds/management/commands/seed_fellowship.py b/opentech/apply/funds/management/commands/seed_fellowship.py index 5426116864fdb336ecf97600b621d677dd256b32..1a233415b89044e3fc4820e4cb5feecfc13cb82f 100644 --- a/opentech/apply/funds/management/commands/seed_fellowship.py +++ b/opentech/apply/funds/management/commands/seed_fellowship.py @@ -134,9 +134,6 @@ class Command(BaseCommand): {"type": "recommendation", "value": {"field_label": "Overall, do you think we should select this applicant and their project to be part of the fellowship program?", "help_text": "", "info": None}, "id": "e1ea4f9d-64e2-4f28-a68a-851ec0f2d9ad"}, {"type": "rich_text", "value": {"field_label": "If no, please select a reason why not.", "help_text": "", "required": "", "default_value": ""}, "id": "e68b6fe9-8b11-4cf0-8ae4-2ffed75e1e80"}, {"type": "rich_text", "value": {"field_label": "If yes, but you believe some changes need to be made to the proposed effort, please let us know.", "help_text": "", "required": "", "default_value": ""}, "id": "a413f3a2-b486-4bf3-9e2d-c48d19626876"}, - {"type": "score", "value": {"field_label": "Goals and principles", "help_text": "", "required": ""}, "id": "d40e541c-ccc0-4ede-94d1-bd8680b47004"}, - {"type": "score", "value": {"field_label": "Technical merit", "help_text": "", "required": ""}, "id": "4af1e000-25be-4cf1-a787-8e5fd91feba8"}, - {"type": "score", "value": {"field_label": "Reasonable and realistic", "help_text": "", "required": ""}, "id": "f839ec7e-1136-4fcd-b59e-c04e02d5abf6"}, {"type": "rich_text", "value": {"field_label": "Request specific questions", "help_text": "", "required": "", "default_value": ""}, "id": "536c963a-f183-45bc-b83f-458b46dc5542"}, {"type": "comments", "value": {"field_label": "Anything else you'd like to give us feedback on?", "help_text": "", "info": None}, "id": "cc82ba7b-b55e-4309-85f0-f68ad6f43471"} ] diff --git a/opentech/apply/funds/management/commands/seed_rapid_response.py b/opentech/apply/funds/management/commands/seed_rapid_response.py index d0089ba5417836e70ed73464a9279f3288c40190..7cf40a7008248c48dcbd7f33c4b67777ed0abc85 100644 --- a/opentech/apply/funds/management/commands/seed_rapid_response.py +++ b/opentech/apply/funds/management/commands/seed_rapid_response.py @@ -100,7 +100,6 @@ class Command(BaseCommand): {"type": "score", "value": {"field_label": "How appropriate are the proposed objectives for rapid response support?", "help_text": "", "required": ""}, "id": "71bfe95d-89c5-401b-ae7a-778e91d5c8c5"}, {"type": "score", "value": {"field_label": "How would you rate the applicant's capacity and knowledge to carry out this project?", "help_text": "", "required": ""}, "id": "3aa164c1-4386-4046-997a-a2778e1d894e"}, {"type": "score", "value": {"field_label": "Does the applicant provide sufficient justification for the amount of funding requested (is this cost effective)?", "help_text": "", "required": ""}, "id": "7cc12bb6-4c12-48aa-a269-1fd6d725abfe"}, - {"type": "rich_text", "value": {"field_label": "Justification comments", "help_text": "", "required": "", "default_value": ""}, "id": "abc61bba-2a9e-4a9e-8c06-a1824ea2a998"}, {"type": "comments", "value": {"field_label": "Other comments", "help_text": "", "info": None}, "id": "d94e51d3-026c-443f-a98a-a66b1f6c968c"} ] diff --git a/opentech/apply/review/management/commands/migrate_concept_reviews.py b/opentech/apply/review/management/commands/migrate_concept_reviews.py index a1eae68706e3bedd0b46c2e6db4f47940575c007..8507acb751b5a0f16116d765370f7f2964e87aec 100644 --- a/opentech/apply/review/management/commands/migrate_concept_reviews.py +++ b/opentech/apply/review/management/commands/migrate_concept_reviews.py @@ -8,163 +8,45 @@ class Command(MigrateCommand): APPLICATION_TYPE = "concept" STREAMFIELD_MAP = { - "title": { - "id": "title", - "type": "direct", - }, - "field_concept_name": { - "id": "full_name", - "type": "value", - "key": "safe_value", - }, - "field_concept_mail": { - "id": "email", - "type": "value", - "key": "email", - }, - "field_concept_preapplied": { - "id": "0305a465-8763-4c1f-9197-4ca4227d452a", - "type": "map", - "map": { - "0": "No", - "1": "Yes", - }, - }, - "field_concept_preapplied_how": { - "id": "c24691be-9861-4dbc-8be4-03b6e68c1973", - "type": "value", - "key": "safe_value", - }, - "field_concept_description": { - "id": "c21c58c3-cfbe-4409-b2f2-8f56398f1731", - "type": "value", - "key": "safe_value", - }, - "field_concept_outcome": { - "id": "27289c14-6926-4f61-bea2-8031a653f71c", - "type": "value", - "key": "safe_value", - }, - "field_type": { - "id": "404e2310-000b-4ccb-b772-3680946ff07d", - "type": "category", - "key": "tid", - }, - "field_proposal_status": { - "id": "145c364f-e0bb-4652-94e8-fe08c831da2b", - "type": "category", - "key": "tid", - }, - "field_technology_attribute": { - "id": "b4da2310-9654-4aa7-a04a-06335967ddc5", - "type": "category", - "key": "tid", - }, - "field_concept_how": { - "id": "418b8099-4525-437f-a55c-9b35745d0384", - "type": "value", - "key": "safe_value", - }, - "field_proposal_focus": { - "id": "390702bd-e4e1-4dc2-8c43-d51bf018b427", - "type": "category", - "key": "tid", - }, - "field_concept_time": { - "id": "duration", - "type": "value", - }, - "field_concept_amount": { - "id": "value", - "type": "value", - }, - "field_concept_how_long": { - "id": "dfb9c307-9328-4a99-9efc-321d474b2ba7", + "field_pr_recommendation_comments": { + "id": "f16be0b3-ef02-4876-b056-8a84238b1a52", "type": "value", "key": "safe_value", }, - "field_concept_who": { - "id": "11f94a22-0571-4491-a93e-87c050e02a4a", - "type": "value", - "key": "safe_value", + "field_cnr_principles_rate": { + "id": "6dd8d5d2-09a5-4681-aebc-eb9ccd00395a", + "type": "score", }, - "field_concept_community": { - "id": "c272969b-d89f-4b6e-859f-4606a15b3f28", - "type": "value", - "key": "safe_value", + "field_cnr_technical_rate": { + "id": "52b1f53c-9656-4b0c-8b8b-a9c57869356d", + "type": "score", }, - "field_proposal_beneficiaries": { - "id": "72002c3e-aaee-47da-9377-8bb493f14c21", - "type": "category", - "key": "tid", + "field_field_cnr_sustainable_rate": { + "id": "aedb27e7-6044-4e04-b2c7-358065c8fe5c", + "type": "score", }, - "field_term_region": { - "id": "369b248e-f669-4aeb-b771-7cba0eadb921", - "type": "category", - "key": "tid", + "field_cnr_principles": { + "id": "6dd8d5d2-09a5-4681-aebc-eb9ccd00395a", + "type": "placeholder", }, - "field_term_country": { - "id": "57bceb33-ebda-4708-9080-fd1a5923e008", - "type": "category", - "key": "tid", - }, - "field_concept_why": { - "id": "c14ee077-c0eb-48b1-9825-fbba9b91ede5", - "type": "value", - "key": "safe_value", + "field_cnr_technical": { + "id": "52b1f53c-9656-4b0c-8b8b-a9c57869356d", + "type": "placeholder", }, - "field_proposal_theme": { - "id": "a83a1884-f711-4196-8d15-ae2110466acb", - "type": "category", - "key": "tid", + "field_cnr_sustainable": { + "id": "aedb27e7-6044-4e04-b2c7-358065c8fe5c", + "type": "placeholder", }, - "field_proposal_similar_efforts": { - "id": "9ca35708-d611-4cd0-8d4a-3cc08349f45b", - "type": "value", + "field_cnr_request_questions": { + "id": "84405ba2-f94e-4d4d-92e1-190bd802f858", + "type": "merge_value", "key": "safe_value", }, - "field_concept_contact": { - "id": "db7b1642-c03d-4af4-82c9-db67bf9713b0", + "field_cnr_comments": { + "id": "comments", "type": "value", "key": "safe_value", }, - "field_concept_upload": { - "id": "8a91231c-5c3d-46fe-9de6-8d5c86817626", - "type": "file", - # TODO: finish mapping - }, - "field_application_otf_mission": { - "id": "4c661a64-2614-4169-b4d2-1fd39e2e831b", - "type": "boolean", - }, - "field_application_otf_tos": { - "id": "1bc4e113-1414-46ff-bba7-2dc02b2126df", - "type": "boolean", - }, - "field_application_otf_represent": { - "id": "42dd68a1-b699-4678-bea6-13e0f842e821", - "type": "boolean", - }, - "field_application_otf_license": { - "id": "72916731-ec97-4688-95f1-d3bf140b03c2", - "type": "boolean", - }, - "field_application_otf_complete": { - "id": "6856d26d-b169-4fdf-b598-63c3dd9278a2", - "type": "boolean", - }, - "field_application_otf_deadline": { - "id": "33838399-f292-4b63-83f0-e02d344f99d4", - "type": "boolean", - }, - "field_application_otf_list": { - "id": "fc571e12-d4a2-4d53-ab34-2c57321dc6ac", - "type": "boolean", - }, - "field_application_otf_newsletter": { - "id": "cd0d8a4b-e71a-4dff-964a-f547bd655e7d", - "type": "boolean", - }, } REQUEST_QUESTION_MAP = { diff --git a/opentech/apply/review/management/commands/migrate_fellowship_application_reviews.py b/opentech/apply/review/management/commands/migrate_fellowship_application_reviews.py index ca57de7e8bb26c31486bd36802ac675f406bf32d..e8c6716ee57c47e3c1927f39f1023f70ea725abb 100644 --- a/opentech/apply/review/management/commands/migrate_fellowship_application_reviews.py +++ b/opentech/apply/review/management/commands/migrate_fellowship_application_reviews.py @@ -8,163 +8,16 @@ class Command(MigrateCommand): APPLICATION_TYPE = "concept" STREAMFIELD_MAP = { - "title": { - "id": "title", - "type": "direct", - }, - "field_concept_name": { - "id": "full_name", - "type": "value", - "key": "safe_value", - }, - "field_concept_mail": { - "id": "email", - "type": "value", - "key": "email", - }, - "field_concept_preapplied": { - "id": "0305a465-8763-4c1f-9197-4ca4227d452a", - "type": "map", - "map": { - "0": "No", - "1": "Yes", - }, - }, - "field_concept_preapplied_how": { - "id": "c24691be-9861-4dbc-8be4-03b6e68c1973", + "field_fr_overall_no": { + "id": "f0533950-57f5-4bb7-81ec-2d3813490c88", "type": "value", "key": "safe_value", }, - "field_concept_description": { - "id": "c21c58c3-cfbe-4409-b2f2-8f56398f1731", - "type": "value", - "key": "safe_value", - }, - "field_concept_outcome": { - "id": "27289c14-6926-4f61-bea2-8031a653f71c", - "type": "value", + "field_far_request_questions": { + "id": "ba789376-e3f9-434e-8da5-330811723b30", + "type": "merge_value", "key": "safe_value", }, - "field_type": { - "id": "404e2310-000b-4ccb-b772-3680946ff07d", - "type": "category", - "key": "tid", - }, - "field_proposal_status": { - "id": "145c364f-e0bb-4652-94e8-fe08c831da2b", - "type": "category", - "key": "tid", - }, - "field_technology_attribute": { - "id": "b4da2310-9654-4aa7-a04a-06335967ddc5", - "type": "category", - "key": "tid", - }, - "field_concept_how": { - "id": "418b8099-4525-437f-a55c-9b35745d0384", - "type": "value", - "key": "safe_value", - }, - "field_proposal_focus": { - "id": "390702bd-e4e1-4dc2-8c43-d51bf018b427", - "type": "category", - "key": "tid", - }, - "field_concept_time": { - "id": "duration", - "type": "value", - }, - "field_concept_amount": { - "id": "value", - "type": "value", - }, - "field_concept_how_long": { - "id": "dfb9c307-9328-4a99-9efc-321d474b2ba7", - "type": "value", - "key": "safe_value", - }, - "field_concept_who": { - "id": "11f94a22-0571-4491-a93e-87c050e02a4a", - "type": "value", - "key": "safe_value", - }, - "field_concept_community": { - "id": "c272969b-d89f-4b6e-859f-4606a15b3f28", - "type": "value", - "key": "safe_value", - }, - "field_proposal_beneficiaries": { - "id": "72002c3e-aaee-47da-9377-8bb493f14c21", - "type": "category", - "key": "tid", - }, - "field_term_region": { - "id": "369b248e-f669-4aeb-b771-7cba0eadb921", - "type": "category", - "key": "tid", - }, - "field_term_country": { - "id": "57bceb33-ebda-4708-9080-fd1a5923e008", - "type": "category", - "key": "tid", - }, - "field_concept_why": { - "id": "c14ee077-c0eb-48b1-9825-fbba9b91ede5", - "type": "value", - "key": "safe_value", - }, - "field_proposal_theme": { - "id": "a83a1884-f711-4196-8d15-ae2110466acb", - "type": "category", - "key": "tid", - }, - "field_proposal_similar_efforts": { - "id": "9ca35708-d611-4cd0-8d4a-3cc08349f45b", - "type": "value", - "key": "safe_value", - }, - "field_concept_contact": { - "id": "db7b1642-c03d-4af4-82c9-db67bf9713b0", - "type": "value", - "key": "safe_value", - }, - "field_concept_upload": { - "id": "8a91231c-5c3d-46fe-9de6-8d5c86817626", - "type": "file", - # TODO: finish mapping - }, - "field_application_otf_mission": { - "id": "4c661a64-2614-4169-b4d2-1fd39e2e831b", - "type": "boolean", - }, - "field_application_otf_tos": { - "id": "1bc4e113-1414-46ff-bba7-2dc02b2126df", - "type": "boolean", - }, - "field_application_otf_represent": { - "id": "42dd68a1-b699-4678-bea6-13e0f842e821", - "type": "boolean", - }, - "field_application_otf_license": { - "id": "72916731-ec97-4688-95f1-d3bf140b03c2", - "type": "boolean", - }, - "field_application_otf_complete": { - "id": "6856d26d-b169-4fdf-b598-63c3dd9278a2", - "type": "boolean", - }, - "field_application_otf_deadline": { - "id": "33838399-f292-4b63-83f0-e02d344f99d4", - "type": "boolean", - }, - "field_application_otf_list": { - "id": "fc571e12-d4a2-4d53-ab34-2c57321dc6ac", - "type": "boolean", - }, - "field_application_otf_newsletter": { - "id": "cd0d8a4b-e71a-4dff-964a-f547bd655e7d", - "type": "boolean", - }, } REQUEST_QUESTION_MAP = { diff --git a/opentech/apply/review/management/commands/migrate_fellowship_proposal_reviews.py b/opentech/apply/review/management/commands/migrate_fellowship_proposal_reviews.py index 75532af75dbe3f4ebc34ccfe1c55b4024e02720f..d831822c5c29bac069e1c212558ad05e3ef5a8ec 100644 --- a/opentech/apply/review/management/commands/migrate_fellowship_proposal_reviews.py +++ b/opentech/apply/review/management/commands/migrate_fellowship_proposal_reviews.py @@ -8,163 +8,26 @@ class Command(MigrateCommand): APPLICATION_TYPE = "proposal" STREAMFIELD_MAP = { - "title": { - "id": "title", - "type": "direct", - }, - "field_concept_name": { - "id": "full_name", - "type": "value", - "key": "safe_value", - }, - "field_concept_mail": { - "id": "email", - "type": "value", - "key": "email", - }, - "field_concept_preapplied": { - "id": "0305a465-8763-4c1f-9197-4ca4227d452a", - "type": "map", - "map": { - "0": "No", - "1": "Yes", - }, - }, - "field_concept_preapplied_how": { - "id": "c24691be-9861-4dbc-8be4-03b6e68c1973", - "type": "value", - "key": "safe_value", - }, - "field_concept_description": { - "id": "c21c58c3-cfbe-4409-b2f2-8f56398f1731", - "type": "value", - "key": "safe_value", - }, - "field_concept_outcome": { - "id": "27289c14-6926-4f61-bea2-8031a653f71c", + "field_fr_overall_no": { + "id": "e68b6fe9-8b11-4cf0-8ae4-2ffed75e1e80", "type": "value", "key": "safe_value", }, - "field_type": { - "id": "404e2310-000b-4ccb-b772-3680946ff07d", - "type": "category", - "key": "tid", - }, - "field_proposal_status": { - "id": "145c364f-e0bb-4652-94e8-fe08c831da2b", - "type": "category", - "key": "tid", - }, - "field_technology_attribute": { - "id": "b4da2310-9654-4aa7-a04a-06335967ddc5", - "type": "category", - "key": "tid", - }, - "field_concept_how": { - "id": "418b8099-4525-437f-a55c-9b35745d0384", + "field_fr_overall_yes": { + "id": "a413f3a2-b486-4bf3-9e2d-c48d19626876", "type": "value", "key": "safe_value", }, - "field_proposal_focus": { - "id": "390702bd-e4e1-4dc2-8c43-d51bf018b427", - "type": "category", - "key": "tid", - }, - "field_concept_time": { - "id": "duration", - "type": "value", - }, - "field_concept_amount": { - "id": "value", - "type": "value", - }, - "field_concept_how_long": { - "id": "dfb9c307-9328-4a99-9efc-321d474b2ba7", + "field_fr_feedback": { + "id": "comments", "type": "value", "key": "safe_value", }, - "field_concept_who": { - "id": "11f94a22-0571-4491-a93e-87c050e02a4a", - "type": "value", + "field_fr_request_questions": { + "id": "536c963a-f183-45bc-b83f-458b46dc5542", + "type": "merge_value", "key": "safe_value", }, - "field_concept_community": { - "id": "c272969b-d89f-4b6e-859f-4606a15b3f28", - "type": "value", - "key": "safe_value", - }, - "field_proposal_beneficiaries": { - "id": "72002c3e-aaee-47da-9377-8bb493f14c21", - "type": "category", - "key": "tid", - }, - "field_term_region": { - "id": "369b248e-f669-4aeb-b771-7cba0eadb921", - "type": "category", - "key": "tid", - }, - "field_term_country": { - "id": "57bceb33-ebda-4708-9080-fd1a5923e008", - "type": "category", - "key": "tid", - }, - "field_concept_why": { - "id": "c14ee077-c0eb-48b1-9825-fbba9b91ede5", - "type": "value", - "key": "safe_value", - }, - "field_proposal_theme": { - "id": "a83a1884-f711-4196-8d15-ae2110466acb", - "type": "category", - "key": "tid", - }, - "field_proposal_similar_efforts": { - "id": "9ca35708-d611-4cd0-8d4a-3cc08349f45b", - "type": "value", - "key": "safe_value", - }, - "field_concept_contact": { - "id": "db7b1642-c03d-4af4-82c9-db67bf9713b0", - "type": "value", - "key": "safe_value", - }, - "field_concept_upload": { - "id": "8a91231c-5c3d-46fe-9de6-8d5c86817626", - "type": "file", - # TODO: finish mapping - }, - "field_application_otf_mission": { - "id": "4c661a64-2614-4169-b4d2-1fd39e2e831b", - "type": "boolean", - }, - "field_application_otf_tos": { - "id": "1bc4e113-1414-46ff-bba7-2dc02b2126df", - "type": "boolean", - }, - "field_application_otf_represent": { - "id": "42dd68a1-b699-4678-bea6-13e0f842e821", - "type": "boolean", - }, - "field_application_otf_license": { - "id": "72916731-ec97-4688-95f1-d3bf140b03c2", - "type": "boolean", - }, - "field_application_otf_complete": { - "id": "6856d26d-b169-4fdf-b598-63c3dd9278a2", - "type": "boolean", - }, - "field_application_otf_deadline": { - "id": "33838399-f292-4b63-83f0-e02d344f99d4", - "type": "boolean", - }, - "field_application_otf_list": { - "id": "fc571e12-d4a2-4d53-ab34-2c57321dc6ac", - "type": "boolean", - }, - "field_application_otf_newsletter": { - "id": "cd0d8a4b-e71a-4dff-964a-f547bd655e7d", - "type": "boolean", - }, } REQUEST_QUESTION_MAP = { diff --git a/opentech/apply/review/management/commands/migrate_proposal_reviews.py b/opentech/apply/review/management/commands/migrate_proposal_reviews.py index 38f1d3f85b8de7479966e40dfeddfe21b68626a9..e679c68563b01eaf0fdeb28f1d071754d9eb86b5 100644 --- a/opentech/apply/review/management/commands/migrate_proposal_reviews.py +++ b/opentech/apply/review/management/commands/migrate_proposal_reviews.py @@ -8,162 +8,138 @@ class Command(MigrateCommand): APPLICATION_TYPE = "proposal" STREAMFIELD_MAP = { - "title": { - "id": "title", - "type": "direct", - }, - "field_concept_name": { - "id": "full_name", - "type": "value", - "key": "safe_value", - }, - "field_concept_mail": { - "id": "email", - "type": "value", - "key": "email", + "field_pr_confidentiality": { + "id": "65fb2c22-a0c5-4cde-94a7-feb27072bc3d", + "type": "boolean", }, - "field_concept_preapplied": { - "id": "0305a465-8763-4c1f-9197-4ca4227d452a", + "field_pr_conflicts": { + "id": "dd75ce49-e3c4-43da-b724-4cb8bb88dcf8", "type": "map", "map": { "0": "No", "1": "Yes", }, }, - "field_concept_preapplied_how": { - "id": "c24691be-9861-4dbc-8be4-03b6e68c1973", + "field_pr_disclosure": { + "id": "9f7fe70b-97b5-4263-98ac-a45bf97b59d0", "type": "value", "key": "safe_value", }, - "field_concept_description": { - "id": "c21c58c3-cfbe-4409-b2f2-8f56398f1731", + "field_pr_liked": { + "id": "e91ed603-61ad-483e-be7b-21716d05a3bd", "type": "value", "key": "safe_value", }, - "field_concept_outcome": { - "id": "27289c14-6926-4f61-bea2-8031a653f71c", + "field_pr_concern": { + "id": "821fb071-7db7-4cc1-ac3a-34b9eee40c94", "type": "value", "key": "safe_value", }, - "field_type": { - "id": "404e2310-000b-4ccb-b772-3680946ff07d", - "type": "category", - "key": "tid", + "field_pr_red_flags": { + "id": "021624ac-6628-430d-ba86-e68fd518c87e", + "type": "value", + "key": "safe_value", }, - "field_proposal_status": { - "id": "145c364f-e0bb-4652-94e8-fe08c831da2b", - "type": "category", - "key": "tid", + "field_pr_overview_rate": { + "id": "9c5603d5-f897-42fa-8739-5935769c94bd", + "type": "score", }, - "field_technology_attribute": { - "id": "b4da2310-9654-4aa7-a04a-06335967ddc5", - "type": "category", - "key": "tid", + "field_pr_objectives_rate": { + "id": "6b748400-fad9-4b31-bb85-e3a53c99f4df", + "type": "score", }, - "field_concept_how": { - "id": "418b8099-4525-437f-a55c-9b35745d0384", - "type": "value", - "key": "safe_value", + "field_pr_strategy_rate": { + "id": "a806a944-1d8a-4904-ace0-acfce5634a50", + "type": "score", }, - "field_proposal_focus": { - "id": "390702bd-e4e1-4dc2-8c43-d51bf018b427", - "type": "category", - "key": "tid", + "field_pr_technical_rate": { + "id": "512a86a5-ec5b-4d36-9630-90648b5b43e4", + "type": "score", }, - "field_concept_time": { - "id": "duration", - "type": "value", + "field_pr_alternative_rate": { + "id": "d9695d1d-3373-4acf-ada5-3b2593b3a634", + "type": "score", }, - "field_concept_amount": { - "id": "value", - "type": "value", + "field_pr_usability_rate": { + "id": "e43dd4dc-d2fa-493c-9f55-5a126d0e0579", + "type": "score", }, - "field_concept_how_long": { - "id": "dfb9c307-9328-4a99-9efc-321d474b2ba7", - "type": "value", - "key": "safe_value", + "field_pr_sustainability_rate": { + "id": "ee7009b8-ad18-46b5-a981-ccc52972c0a5", + "type": "score", }, - "field_concept_who": { - "id": "11f94a22-0571-4491-a93e-87c050e02a4a", - "type": "value", - "key": "safe_value", + "field_pr_collaboration_rate": { + "id": "dc5dc5e0-e4d6-462f-8296-a0e58933e701", + "type": "score", }, - "field_concept_community": { - "id": "c272969b-d89f-4b6e-859f-4606a15b3f28", - "type": "value", - "key": "safe_value", + "field_pr_realism_rate": { + "id": "31e9b202-24b1-4993-80b7-9851624e2162", + "type": "score", }, - "field_proposal_beneficiaries": { - "id": "72002c3e-aaee-47da-9377-8bb493f14c21", - "type": "category", - "key": "tid", + "field_pr_qualifications_rate": { + "id": "d3f5479c-68da-41d9-a266-130d383bab6b", + "type": "score", }, - "field_term_region": { - "id": "369b248e-f669-4aeb-b771-7cba0eadb921", - "type": "category", - "key": "tid", + "field_pr_evaluation_rate": { + "id": "2a61c71a-74f6-4963-8850-9289e852f604", + "type": "score", }, - "field_term_country": { - "id": "57bceb33-ebda-4708-9080-fd1a5923e008", - "type": "category", - "key": "tid", + "field_pr_rationale_rate": { + "id": "0d1bf533-968c-44b9-bb30-d437ae039474", + "type": "score", }, - "field_concept_why": { - "id": "c14ee077-c0eb-48b1-9825-fbba9b91ede5", - "type": "value", - "key": "safe_value", + "field_pr_overview": { + "id": "9c5603d5-f897-42fa-8739-5935769c94bd", + "type": "placeholder", }, - "field_proposal_theme": { - "id": "a83a1884-f711-4196-8d15-ae2110466acb", - "type": "category", - "key": "tid", + "field_pr_objectives": { + "id": "6b748400-fad9-4b31-bb85-e3a53c99f4df", + "type": "placeholder", }, - "field_proposal_similar_efforts": { - "id": "9ca35708-d611-4cd0-8d4a-3cc08349f45b", - "type": "value", - "key": "safe_value", + "field_pr_strategy": { + "id": "a806a944-1d8a-4904-ace0-acfce5634a50", + "type": "placeholder", }, - "field_concept_contact": { - "id": "db7b1642-c03d-4af4-82c9-db67bf9713b0", - "type": "value", - "key": "safe_value", + "field_pr_technical": { + "id": "512a86a5-ec5b-4d36-9630-90648b5b43e4", + "type": "placeholder", }, - "field_concept_upload": { - "id": "8a91231c-5c3d-46fe-9de6-8d5c86817626", - "type": "file", - # TODO: finish mapping + "field_pr_alternative": { + "id": "d9695d1d-3373-4acf-ada5-3b2593b3a634", + "type": "placeholder", }, - "field_application_otf_mission": { - "id": "4c661a64-2614-4169-b4d2-1fd39e2e831b", - "type": "boolean", + "field_pr_usability": { + "id": "e43dd4dc-d2fa-493c-9f55-5a126d0e0579", + "type": "placeholder", }, - "field_application_otf_tos": { - "id": "1bc4e113-1414-46ff-bba7-2dc02b2126df", - "type": "boolean", + "field_pr_sustainability": { + "id": "ee7009b8-ad18-46b5-a981-ccc52972c0a5", + "type": "placeholder", }, - "field_application_otf_represent": { - "id": "42dd68a1-b699-4678-bea6-13e0f842e821", - "type": "boolean", + "field_pr_collaboration": { + "id": "dc5dc5e0-e4d6-462f-8296-a0e58933e701", + "type": "placeholder", }, - "field_application_otf_license": { - "id": "72916731-ec97-4688-95f1-d3bf140b03c2", - "type": "boolean", + "field_pr_realism": { + "id": "31e9b202-24b1-4993-80b7-9851624e2162", + "type": "placeholder", }, - "field_application_otf_complete": { - "id": "6856d26d-b169-4fdf-b598-63c3dd9278a2", - "type": "boolean", + "field_pr_qualifications": { + "id": "d3f5479c-68da-41d9-a266-130d383bab6b", + "type": "placeholder", }, - "field_application_otf_deadline": { - "id": "33838399-f292-4b63-83f0-e02d344f99d4", - "type": "boolean", + "field_pr_evaluation": { + "id": "2a61c71a-74f6-4963-8850-9289e852f604", + "type": "placeholder", }, - "field_application_otf_list": { - "id": "fc571e12-d4a2-4d53-ab34-2c57321dc6ac", - "type": "boolean", + "field_pr_rationale": { + "id": "0d1bf533-968c-44b9-bb30-d437ae039474", + "type": "placeholder", }, - "field_application_otf_newsletter": { - "id": "cd0d8a4b-e71a-4dff-964a-f547bd655e7d", - "type": "boolean", + "field_pr_recommendation_comments": { + "id": "comments", + "type": "value", + "key": "safe_value", }, } diff --git a/opentech/apply/review/management/commands/migrate_rr_reviews.py b/opentech/apply/review/management/commands/migrate_rr_reviews.py index b286144dff1f4acaf8efd21baf5d8dabbdd9fe55..6d9c3d3bb36efb1aa3bd41279e1595e0afd11f33 100644 --- a/opentech/apply/review/management/commands/migrate_rr_reviews.py +++ b/opentech/apply/review/management/commands/migrate_rr_reviews.py @@ -35,4 +35,16 @@ class Command(MigrateCommand): "type": "value", "key": "safe_value", }, + "field_rrr_objectives": { + "id": "38339ef8-8b57-4098-afc8-c3956fdf8333", + "type": "placeholder", + }, + "field_rrr_capacity": { + "id": "f88a4436-cad8-4131-8a32-595c55810606", + "type": "placeholder", + }, + "field_rrr_justification": { + "id": "8d4c9191-ce68-4788-a7f6-66cef5a66288", + "type": "placeholder", + }, } diff --git a/opentech/apply/review/management/commands/migration_review_base.py b/opentech/apply/review/management/commands/migration_review_base.py index 1591b4db3829cdff4b287a0cc7e43cf10fc43c9d..d00b1a72c491e262d4d4f81ce2b3e06d5202c5e2 100644 --- a/opentech/apply/review/management/commands/migration_review_base.py +++ b/opentech/apply/review/management/commands/migration_review_base.py @@ -84,7 +84,8 @@ class MigrateCommand(BaseCommand): with options['source'] as json_data: self.data = json.load(json_data) - blacklist = {"7574", "7413", "7412", "5270", "6468", "6436", "5511", "3490", "2840", "2837", "2737"} + # A user can only submitt a single review in the new system so pick the latest one. + blacklist = {"7574", "7413", "7412", "5270", "6468", "6436", "5511", "3490", "2840", "2837", "2737", "9362", "9203", "8958", "13313", "4868", "4867", "5863", "5770", "3962", "3747"} counter = 0 for id in self.data: @@ -183,18 +184,24 @@ class MigrateCommand(BaseCommand): values = [] i = 0 for item in source_value: - question = self.REQUEST_QUESTION_MAP[node['field_application_request']['target_id']] - values.append(f"<strong>{question[i]}</strong>{item[key]}<br>\n") + question = self.REQUEST_QUESTION_MAP[node['request_nid']] + if i in question: + values.append(f"<strong>{question[i]}</strong>{item[key]}<br>\n") i += 1 merged_values = ''.join(values) value = self.nl2br(merged_values) if source_value else '' elif mapping_type == 'score': - value_rate = int(source_value[key]) if source_value else None + value_rate = int(source_value[key]) if source_value else NA value_text = '' if "_rate" in field: + field = field.replace('field_field_', 'field_') text_field = field[:-5] if text_field in self.STREAMFIELD_MAP: - value_text = self.nl2br(node[text_field]['safe_value']) + value_text_field = node[text_field] + if 'safe_value' in value_text_field: + value_text = self.nl2br(value_text_field['safe_value']) if value_text_field else '' + else: + value_text = self.nl2br(value_text_field['value']) if value_text_field else '' value = [value_text, value_rate] elif mapping_type == 'map' and 'map' in 'mapping': value = mapping['map'].get(source_value[key])