From 3e70ee2a9ca4518631465cdc8c7b6cb3e21fcaf9 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Wed, 3 May 2023 09:51:39 -0700 Subject: [PATCH 01/12] Bump terser from 4.8.0 to 4.8.1 --- package.json | 3 ++- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b5f8c0c57..137ce9c32 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,8 @@ "ws": "^5.2.3", "dns-packet": "^1.3.4", "browserslist": "^4.16.6", - "async": "^2.6.4" + "async": "^2.6.4", + "terser": "4.8.1" }, "jest": { "automock": false, diff --git a/yarn.lock b/yarn.lock index b4a800f36..e7623dd38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8749,10 +8749,10 @@ terser-webpack-plugin@^2.3.5: terser "^4.6.12" webpack-sources "^1.4.3" -terser@^4.1.2, terser@^4.6.12: - version "4.8.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" - integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== +terser@4.8.1, terser@^4.1.2, terser@^4.6.12: + version "4.8.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" + integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== dependencies: commander "^2.20.0" source-map "~0.6.1" From d04177f0802831aa8efd44f869c94e495483afbb Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Wed, 3 May 2023 09:57:29 -0700 Subject: [PATCH 02/12] Bump moment-timezone from 0.5.21 to 0.5.35 --- package.json | 2 +- yarn.lock | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 137ce9c32..8ae9b201d 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "lodash": "^4.17.21", "mini-css-extract-plugin": "^0.9.0", "moment": "^2.22.2", - "moment-timezone": "^0.5.21", + "moment-timezone": "^0.5.35", "optimize-css-assets-webpack-plugin": "^5.0.3", "path": "^0.12.7", "react": "^16.11.0", diff --git a/yarn.lock b/yarn.lock index e7623dd38..87c4d2ff8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6214,18 +6214,23 @@ mixin-deep@^1.2.0, mixin-deep@^1.3.2: dependencies: minimist "^1.2.6" -moment-timezone@^0.5.21: - version "0.5.34" - resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.34.tgz#a75938f7476b88f155d3504a9343f7519d9a405c" - integrity sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg== +moment-timezone@^0.5.35: + version "0.5.43" + resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.43.tgz#3dd7f3d0c67f78c23cd1906b9b2137a09b3c4790" + integrity sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ== dependencies: - moment ">= 2.9.0" + moment "^2.29.4" -"moment@>= 2.9.0", moment@^2.22.2: +moment@^2.22.2: version "2.29.3" resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.3.tgz#edd47411c322413999f7a5940d526de183c031f3" integrity sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw== +moment@^2.29.4: + version "2.29.4" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" + integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== + move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" From e99027c470f46f5a6ca2475ffce683a65d896332 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Mon, 8 May 2023 18:31:05 -0700 Subject: [PATCH 03/12] Bump moment from 2.22.2 to 2.29.4 --- package.json | 2 +- yarn.lock | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/package.json b/package.json index 8ae9b201d..e867857d1 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "immutable": "^3.8.2", "lodash": "^4.17.21", "mini-css-extract-plugin": "^0.9.0", - "moment": "^2.22.2", + "moment": "^2.29.4", "moment-timezone": "^0.5.35", "optimize-css-assets-webpack-plugin": "^5.0.3", "path": "^0.12.7", diff --git a/yarn.lock b/yarn.lock index 87c4d2ff8..8b012339c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6221,11 +6221,6 @@ moment-timezone@^0.5.35: dependencies: moment "^2.29.4" -moment@^2.22.2: - version "2.29.3" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.3.tgz#edd47411c322413999f7a5940d526de183c031f3" - integrity sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw== - moment@^2.29.4: version "2.29.4" resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" From 50da4b6c1fdb9687671f891c7c30e98c4f3f8749 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Mon, 8 May 2023 18:55:45 -0700 Subject: [PATCH 04/12] Bump decode-uri-component to 0.2.2 --- package.json | 3 ++- yarn.lock | 29 +++++++++++++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index e867857d1..a868748aa 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,8 @@ "dns-packet": "^1.3.4", "browserslist": "^4.16.6", "async": "^2.6.4", - "terser": "4.8.1" + "terser": "^4.8.1", + "decode-uri-component": "^0.2.2" }, "jest": { "automock": false, diff --git a/yarn.lock b/yarn.lock index 8b012339c..924152d9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3214,10 +3214,10 @@ decode-named-character-reference@^1.0.0: dependencies: character-entities "^2.0.0" -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= +decode-uri-component@^0.2.0, decode-uri-component@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== deep-equal@^1.0.1, deep-equal@^1.1.1: version "1.1.1" @@ -5556,7 +5556,12 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2, json5@^2.2.1: +json5@^2.1.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +json5@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== @@ -5657,18 +5662,18 @@ loader-runner@^2.4.0: integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + version "1.4.2" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" + integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" json5 "^1.0.1" loader-utils@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129" - integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== + version "2.0.4" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" + integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" @@ -8749,7 +8754,7 @@ terser-webpack-plugin@^2.3.5: terser "^4.6.12" webpack-sources "^1.4.3" -terser@4.8.1, terser@^4.1.2, terser@^4.6.12: +terser@^4.1.2, terser@^4.6.12, terser@^4.8.1: version "4.8.1" resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f" integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw== From 0addd8b56a14973f7c7edf137712e2ea789f8bd0 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Mon, 8 May 2023 19:07:34 -0700 Subject: [PATCH 05/12] Bump json5 to 1.0.1 --- package.json | 3 ++- yarn.lock | 12 +----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index a868748aa..512b5987b 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,8 @@ "browserslist": "^4.16.6", "async": "^2.6.4", "terser": "^4.8.1", - "decode-uri-component": "^0.2.2" + "decode-uri-component": "^0.2.2", + "json5": "^1.0.1" }, "jest": { "automock": false, diff --git a/yarn.lock b/yarn.lock index 924152d9e..029c63369 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5549,23 +5549,13 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^1.0.1: +json5@^1.0.1, json5@^2.1.2, json5@^2.2.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== dependencies: minimist "^1.2.0" -json5@^2.1.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -json5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== - jsprim@^1.2.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" From 3898edf6503d84de3707dfbd497a0e994f24fb41 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Mon, 8 May 2023 19:09:52 -0700 Subject: [PATCH 06/12] Bump json5 to 1.0.2 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 512b5987b..2206f8282 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "async": "^2.6.4", "terser": "^4.8.1", "decode-uri-component": "^0.2.2", - "json5": "^1.0.1" + "json5": "^1.0.2" }, "jest": { "automock": false, diff --git a/yarn.lock b/yarn.lock index 029c63369..62129ca72 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5549,10 +5549,10 @@ json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^1.0.1, json5@^2.1.2, json5@^2.2.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== +json5@^1.0.1, json5@^1.0.2, json5@^2.1.2, json5@^2.2.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" From 4a8032966b11d90dde159e248127eedf73f6f200 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Mon, 8 May 2023 21:05:46 -0700 Subject: [PATCH 07/12] Bump ua-parser-js from 0.7.28 to 0.7.33 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2206f8282..bae3d6d35 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "yargs-parser": "^5.0.1", "ssri": "^6.0.2", "url-parse": "^1.5.3", - "ua-parser-js": "^0.7.28", + "ua-parser-js": "^0.7.33", "hosted-git-info": "^2.8.9", "elliptic": "^6.5.4", "tmpl": "^1.0.5", diff --git a/yarn.lock b/yarn.lock index 62129ca72..ac78f32a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8924,10 +8924,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -ua-parser-js@^0.7.28, ua-parser-js@^0.7.30: - version "0.7.31" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6" - integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ== +ua-parser-js@^0.7.30, ua-parser-js@^0.7.33: + version "0.7.35" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.35.tgz#8bda4827be4f0b1dda91699a29499575a1f1d307" + integrity sha512-veRf7dawaj9xaWEu9HoTVn5Pggtc/qj+kqTOFvNiN1l0YdxwC1kvel57UCjThjGa3BHBihE8/UJAHI+uQHmd/g== unbox-primitive@^1.0.2: version "1.0.2" From 0107a1ec9ab4895567a430afaa1084bcdd26597e Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Sat, 20 May 2023 11:22:37 -0700 Subject: [PATCH 08/12] Fix dismissal email message --- civictechprojects/views.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/civictechprojects/views.py b/civictechprojects/views.py index 4cfce8978..a1d1732fb 100644 --- a/civictechprojects/views.py +++ b/civictechprojects/views.py @@ -983,8 +983,6 @@ def dismiss_project_volunteer(request, application_id): body = json.loads(request.body) message = body['dismissal_message'] email_template = HtmlEmailTemplate()\ - .paragraph('The owner of {project_name} has removed you from the project for the following reason:'.format( - project_name=volunteer_relation.project.project_name))\ .paragraph('Thank you for contributing to {project_name}. Your volunteer work for the project has ended. \"{message}\"'\ .format(project_name=volunteer_relation.project.project_name, message=message)) email_subject = 'Thank you for your work at {project_name}'.format( From e319476207ab14a2bd91fd556b2249127ae8f829 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Sat, 20 May 2023 13:31:41 -0700 Subject: [PATCH 09/12] Update prospectus pdf links for 2023 --- .../components/controllers/CorporateHackathonController.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/components/controllers/CorporateHackathonController.jsx b/common/components/controllers/CorporateHackathonController.jsx index d26ad4355..d9efec9ce 100644 --- a/common/components/controllers/CorporateHackathonController.jsx +++ b/common/components/controllers/CorporateHackathonController.jsx @@ -441,7 +441,7 @@ class CorporateHackathonController extends React.PureComponent<{||}, State> { return ( Corporate Tech-for-Good Hackathons PDF{" "} @@ -453,7 +453,7 @@ class CorporateHackathonController extends React.PureComponent<{||}, State> { return ( Sponsor Prospectus PDF{" "} From d434842e77054b7bf2787479bb85ac3f0f52d6e2 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Sun, 21 May 2023 09:16:38 -0700 Subject: [PATCH 10/12] Add default PASSWORD_RESET_TIMEOUT_DAYS environment variable value --- democracylab/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/democracylab/settings.py b/democracylab/settings.py index eb5fe390d..af28087e3 100644 --- a/democracylab/settings.py +++ b/democracylab/settings.py @@ -485,3 +485,5 @@ def read_connection_config(config): MALICIOUS_URL_PATTERNS = os.environ.get('MALICIOUS_URL_PATTERNS', None) MALICIOUS_FWD_PATTERNS = os.environ.get('MALICIOUS_FWD_PATTERNS', None) + +PASSWORD_RESET_TIMEOUT_DAYS = os.environ.get('PASSWORD_RESET_TIMEOUT_DAYS', 7) \ No newline at end of file From 179ce6895793f32fd6898f26dcb233cf2fba4cc2 Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Mon, 19 Jun 2023 16:10:08 -0700 Subject: [PATCH 11/12] Update django-taggit to 2.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0dd6cb275..ff31a78d9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ django-registration==3.1.2 django-rq==2.4.1 django-s3direct==0.4.2 django-storages==1.5.1 -django-taggit==1.3.0 +django-taggit==2.1 django-timezone-field==4.2.3 django-debreach==2.0.1 djangorestframework==3.14.0 From 432299f4deabd3ef315ccf30a15d781d261f0b5c Mon Sep 17 00:00:00 2001 From: Marlon Keating Date: Mon, 19 Jun 2023 21:33:25 -0700 Subject: [PATCH 12/12] Update django-taggit to 4.0 and migrate --- .../0063_alter_taggedcategory_tag_and_more.py | 105 +++ .../0010_alter_usertaggedtechnologies_tag.py | 24 + democracylab/settings.py | 626 ++++++++++-------- requirements.txt | 2 +- 4 files changed, 475 insertions(+), 282 deletions(-) create mode 100644 civictechprojects/migrations/0063_alter_taggedcategory_tag_and_more.py create mode 100644 democracylab/migrations/0010_alter_usertaggedtechnologies_tag.py diff --git a/civictechprojects/migrations/0063_alter_taggedcategory_tag_and_more.py b/civictechprojects/migrations/0063_alter_taggedcategory_tag_and_more.py new file mode 100644 index 000000000..d44c1d662 --- /dev/null +++ b/civictechprojects/migrations/0063_alter_taggedcategory_tag_and_more.py @@ -0,0 +1,105 @@ +# Generated by Django 4.2 on 2023-06-20 03:42 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("taggit", "0003_taggeditem_add_unique_index"), + ("civictechprojects", "0062_auto_20230112_0100"), + ] + + operations = [ + migrations.AlterField( + model_name="taggedcategory", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedeventorganization", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedissueareas", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedorganization", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedorganizationtype", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedpositionrole", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedrsvpvolunteerrole", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedstage", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedtechnologies", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + migrations.AlterField( + model_name="taggedvolunteerrole", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + ] diff --git a/democracylab/migrations/0010_alter_usertaggedtechnologies_tag.py b/democracylab/migrations/0010_alter_usertaggedtechnologies_tag.py new file mode 100644 index 000000000..508c2c82d --- /dev/null +++ b/democracylab/migrations/0010_alter_usertaggedtechnologies_tag.py @@ -0,0 +1,24 @@ +# Generated by Django 4.2 on 2023-06-20 03:42 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("taggit", "0003_taggeditem_add_unique_index"), + ("democracylab", "0009_auto_20210302_2036"), + ] + + operations = [ + migrations.AlterField( + model_name="usertaggedtechnologies", + name="tag", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="%(app_label)s_%(class)s_items", + to="taggit.tag", + ), + ), + ] diff --git a/democracylab/settings.py b/democracylab/settings.py index af28087e3..a0d1dd322 100644 --- a/democracylab/settings.py +++ b/democracylab/settings.py @@ -6,7 +6,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ -#TODO: Call out any missing required environment variables during startup +# TODO: Call out any missing required environment variables during startup import os import ast import dj_database_url @@ -23,164 +23,167 @@ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY') +SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = strtobool(os.environ.get('DJANGO_DEBUG')) +DEBUG = strtobool(os.environ.get("DJANGO_DEBUG")) -ALLOWED_HOSTS = ['*'] +ALLOWED_HOSTS = ["*"] -S3_BUCKET = os.environ.get('S3_BUCKET') -S3_BUCKET_URL = 'https://{bucket}.s3.amazonaws.com'.format(bucket=S3_BUCKET) +S3_BUCKET = os.environ.get("S3_BUCKET") +S3_BUCKET_URL = "https://{bucket}.s3.amazonaws.com".format(bucket=S3_BUCKET) # Application definition INSTALLED_APPS = [ - 'civictechprojects.apps.CivictechprojectsConfig', - 'common.apps.CommonConfig', - 'democracylab.apps.DemocracylabConfig', - 'oauth2.apps.OAuth2Config', - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.gis', - 'django.contrib.messages', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.sitemaps', - 'django.contrib.staticfiles', - 'rest_framework', - 'corsheaders', - 'taggit', - 'allauth', - 'allauth.account', - 'allauth.socialaccount', - 'oauth2.providers.github', - 'oauth2.providers.google', - 'oauth2.providers.linkedin', - 'oauth2.providers.facebook', - 'django_rq', - 'salesforce' + "civictechprojects.apps.CivictechprojectsConfig", + "common.apps.CommonConfig", + "democracylab.apps.DemocracylabConfig", + "oauth2.apps.OAuth2Config", + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.gis", + "django.contrib.messages", + "django.contrib.sessions", + "django.contrib.sites", + "django.contrib.sitemaps", + "django.contrib.staticfiles", + "rest_framework", + "corsheaders", + "taggit", + "allauth", + "allauth.account", + "allauth.socialaccount", + "oauth2.providers.github", + "oauth2.providers.google", + "oauth2.providers.linkedin", + "oauth2.providers.facebook", + "django_rq", + "salesforce", ] SITE_ID = 1 +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" + # Customize allauth.socialaccount -ACCOUNT_ADAPTER = 'oauth2.adapter.MyAccountAdapter' -SOCIALACCOUNT_ADAPTER = 'oauth2.adapter.SocialAccountAdapter' +ACCOUNT_ADAPTER = "oauth2.adapter.MyAccountAdapter" +SOCIALACCOUNT_ADAPTER = "oauth2.adapter.SocialAccountAdapter" SOCIALACCOUNT_QUERY_EMAIL = True -SOCIALACCOUNT_EMAIL_VERIFICATION = 'none' +SOCIALACCOUNT_EMAIL_VERIFICATION = "none" SOCIALACCOUNT_AUTO_SIGNUP = True # Bypass the signup form -SOCIALACCOUNT_STORE_TOKENS = False # Token table has foreign key on SocialApp table, which we're not using -SOCIAL_APPS_environ = os.environ.get('SOCIAL_APPS', None) +# Token table has foreign key on SocialApp table, which we're not using +SOCIALACCOUNT_STORE_TOKENS = False +SOCIAL_APPS_environ = os.environ.get("SOCIAL_APPS", None) if SOCIAL_APPS_environ is not None: SOCIAL_APPS = ast.literal_eval(SOCIAL_APPS_environ) - SOCIAL_APPS_VISIBILITY = {app: SOCIAL_APPS[app]["public"] for app in SOCIAL_APPS.keys()} + SOCIAL_APPS_VISIBILITY = { + app: SOCIAL_APPS[app]["public"] for app in SOCIAL_APPS.keys() + } SOCIALACCOUNT_PROVIDERS = { - 'github': { - 'SCOPE': ['read:user', 'user:email'] - }, - 'google': { - 'SCOPE': ['profile', 'email'], - 'AUTH_PARAMS': {'access_type': 'online'} - }, - 'linkedin': { - 'SCOPE': ['r_liteprofile', 'r_emailaddress'] - }, - 'facebook': { - 'SCOPE': ['email', 'public_profile'], - 'AUTH_PARAMS': {'auth_type': 'reauthenticate'}, - 'METHOD': 'oauth2' # instead of 'js_sdk' + "github": {"SCOPE": ["read:user", "user:email"]}, + "google": {"SCOPE": ["profile", "email"], "AUTH_PARAMS": {"access_type": "online"}}, + "linkedin": {"SCOPE": ["r_liteprofile", "r_emailaddress"]}, + "facebook": { + "SCOPE": ["email", "public_profile"], + "AUTH_PARAMS": {"auth_type": "reauthenticate"}, + "METHOD": "oauth2", # instead of 'js_sdk' }, } -GITHUB_API_TOKEN = os.environ.get('GITHUB_API_TOKEN', None) +GITHUB_API_TOKEN = os.environ.get("GITHUB_API_TOKEN", None) AUTHENTICATION_BACKENDS = ( - 'django.contrib.auth.backends.ModelBackend', - 'allauth.account.auth_backends.AuthenticationBackend', + "django.contrib.auth.backends.ModelBackend", + "allauth.account.auth_backends.AuthenticationBackend", ) MIDDLEWARE = [ - 'common.helpers.malicious_requests.MaliciousRequestsMiddleware', - 'common.helpers.redirectors.RedirectMiddleware', - 'django.middleware.security.SecurityMiddleware', - 'whitenoise.middleware.WhiteNoiseMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'corsheaders.middleware.CorsMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'csp.middleware.CSPMiddleware', - 'django.middleware.gzip.GZipMiddleware', - 'debreach.middleware.RandomCommentMiddleware', + "common.helpers.malicious_requests.MaliciousRequestsMiddleware", + "common.helpers.redirectors.RedirectMiddleware", + "django.middleware.security.SecurityMiddleware", + "whitenoise.middleware.WhiteNoiseMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "corsheaders.middleware.CorsMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", + "csp.middleware.CSPMiddleware", + "django.middleware.gzip.GZipMiddleware", + "debreach.middleware.RandomCommentMiddleware", ] -ROOT_URLCONF = 'democracylab.urls' +ROOT_URLCONF = "democracylab.urls" TEMPLATES = [ { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [ - os.path.join(PROJECT_ROOT, 'democracylab/templates'), - os.path.join(PROJECT_ROOT, 'democracylab/templates/emails'), - os.path.join(PROJECT_ROOT, 'civictechprojects/templates') + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [ + os.path.join(PROJECT_ROOT, "democracylab/templates"), + os.path.join(PROJECT_ROOT, "democracylab/templates/emails"), + os.path.join(PROJECT_ROOT, "civictechprojects/templates"), ], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", ], }, }, ] -WSGI_APPLICATION = 'democracylab.wsgi.application' +WSGI_APPLICATION = "democracylab.wsgi.application" # Database # https://docs.djangoproject.com/en/1.11/ref/settings/#databases -DL_DATABASE = os.environ.get('DL_DATABASE', '') -HOSTNAME = os.environ.get('HOSTNAME', '127.0.0.1') - -DATABASES = ast.literal_eval(DL_DATABASE) if DL_DATABASE else { - 'default': { - 'ENGINE': 'django.contrib.gis.db.backends.postgis', - 'NAME': os.getenv("POSTGRES_DB"), - 'USER': os.getenv("POSTGRES_USER"), - 'PASSWORD': os.getenv("POSTGRES_PASSWORD"), - 'HOST': os.getenv("POSTGRES_HOST"), - 'PORT': '5432', +DL_DATABASE = os.environ.get("DL_DATABASE", "") +HOSTNAME = os.environ.get("HOSTNAME", "127.0.0.1") + +DATABASES = ( + ast.literal_eval(DL_DATABASE) + if DL_DATABASE + else { + "default": { + "ENGINE": "django.contrib.gis.db.backends.postgis", + "NAME": os.getenv("POSTGRES_DB"), + "USER": os.getenv("POSTGRES_USER"), + "PASSWORD": os.getenv("POSTGRES_PASSWORD"), + "HOST": os.getenv("POSTGRES_HOST"), + "PORT": "5432", + } } -} +) db_from_env = dj_database_url.config() -DATABASES['default'].update(db_from_env) -DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis' +DATABASES["default"].update(db_from_env) +DATABASES["default"]["ENGINE"] = "django.contrib.gis.db.backends.postgis" -LOGIN_REDIRECT_URL = '/' +LOGIN_REDIRECT_URL = "/" -REDIS_ENABLED = os.environ.get('REDIS_ENABLED', False) == 'True' +REDIS_ENABLED = os.environ.get("REDIS_ENABLED", False) == "True" RQ_QUEUES = { - 'default': { - 'URL': os.getenv('REDIS_URL', 'redis://localhost:6379/0'), # If you're on Heroku - 'DEFAULT_TIMEOUT': 500, + "default": { + # If you're on Heroku + "URL": os.getenv("REDIS_URL", "redis://localhost:6379/0"), + "DEFAULT_TIMEOUT": 500, }, } -#Caching number of tag counts only for now - change this if other things are db-cached +# Caching number of tag counts only for now - change this if other things are db-cached CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.db.DatabaseCache', - 'LOCATION': 'default_db_cache', + "default": { + "BACKEND": "django.core.cache.backends.db.DatabaseCache", + "LOCATION": "default_db_cache", } } @@ -191,203 +194,261 @@ # TODO: Find a validator for verifying password contains at least 1 number, letter, and non-alphanumeric character AUTH_PASSWORD_VALIDATORS = [ { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", }, ] -THROTTLE_RATE_ANONYMOUS = os.environ.get('THROTTLE_RATE_ANONYMOUS', '5/second') -THROTTLE_RATE_AUTHENTICATED = os.environ.get('THROTTLE_RATE_AUTHENTICATED', '5/second') +THROTTLE_RATE_ANONYMOUS = os.environ.get("THROTTLE_RATE_ANONYMOUS", "5/second") +THROTTLE_RATE_AUTHENTICATED = os.environ.get("THROTTLE_RATE_AUTHENTICATED", "5/second") REST_FRAMEWORK = { - 'DEFAULT_PERMISSION_CLASSES': [ - 'rest_framework.permissions.AllowAny', + "DEFAULT_PERMISSION_CLASSES": [ + "rest_framework.permissions.AllowAny", ], - 'PAGE_SIZE': 10, - 'DEFAULT_THROTTLE_CLASSES': [ - 'rest_framework.throttling.AnonRateThrottle', - 'rest_framework.throttling.UserRateThrottle' + "PAGE_SIZE": 10, + "DEFAULT_THROTTLE_CLASSES": [ + "rest_framework.throttling.AnonRateThrottle", + "rest_framework.throttling.UserRateThrottle", ], - 'DEFAULT_THROTTLE_RATES': { - 'anon': THROTTLE_RATE_ANONYMOUS, - 'user': THROTTLE_RATE_AUTHENTICATED - } + "DEFAULT_THROTTLE_RATES": { + "anon": THROTTLE_RATE_ANONYMOUS, + "user": THROTTLE_RATE_AUTHENTICATED, + }, } def read_connection_config(config): return config and { - 'from_name': '{name} <{email_address}>'.format(name=config['display_name'], email_address=config['username']), - 'connection': EmailBackend( - host=config['host'], - port=int(config['port']), - username=config['username'], - password=config['password'], - use_tls=strtobool(config['use_tls']), + "from_name": "{name} <{email_address}>".format( + name=config["display_name"], email_address=config["username"] + ), + "connection": EmailBackend( + host=config["host"], + port=int(config["port"]), + username=config["username"], + password=config["password"], + use_tls=strtobool(config["use_tls"]), fail_silently=False, - use_ssl=strtobool(config['use_ssl']), + use_ssl=strtobool(config["use_ssl"]), timeout=None, ssl_keyfile=None, - ssl_certfile=None) + ssl_certfile=None, + ), } -EMAIL_SUPPORT_ACCT = read_connection_config(ast.literal_eval(os.environ.get('EMAIL_SUPPORT_ACCT', 'None'))) -EMAIL_VOLUNTEER_ACCT = read_connection_config(ast.literal_eval(os.environ.get('EMAIL_VOLUNTEER_ACCT', 'None'))) + +EMAIL_SUPPORT_ACCT = read_connection_config( + ast.literal_eval(os.environ.get("EMAIL_SUPPORT_ACCT", "None")) +) +EMAIL_VOLUNTEER_ACCT = read_connection_config( + ast.literal_eval(os.environ.get("EMAIL_VOLUNTEER_ACCT", "None")) +) # Default log to console in the absence of any account configurations -EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' if EMAIL_SUPPORT_ACCT and EMAIL_VOLUNTEER_ACCT else 'django.core.mail.backends.console.EmailBackend' +EMAIL_BACKEND = ( + "django.core.mail.backends.smtp.EmailBackend" + if EMAIL_SUPPORT_ACCT and EMAIL_VOLUNTEER_ACCT + else "django.core.mail.backends.console.EmailBackend" +) -PROTOCOL_DOMAIN = os.environ['PROTOCOL_DOMAIN'] -ADMIN_EMAIL = os.getenv('ADMIN_EMAIL') -CONTACT_EMAIL = os.environ['CONTACT_EMAIL'] -FAKE_EMAILS = not EMAIL_SUPPORT_ACCT or not EMAIL_VOLUNTEER_ACCT or os.environ.get('FAKE_EMAILS', False) == 'True' +PROTOCOL_DOMAIN = os.environ["PROTOCOL_DOMAIN"] +ADMIN_EMAIL = os.getenv("ADMIN_EMAIL") +CONTACT_EMAIL = os.environ["CONTACT_EMAIL"] +FAKE_EMAILS = ( + not EMAIL_SUPPORT_ACCT + or not EMAIL_VOLUNTEER_ACCT + or os.environ.get("FAKE_EMAILS", False) == "True" +) -MAILCHIMP_API_KEY = os.environ.get('MAILCHIMP_API_KEY', None) -MAILCHIMP_SUBSCRIBE_LIST_ID = os.environ.get('MAILCHIMP_SUBSCRIBE_LIST_ID', None) +MAILCHIMP_API_KEY = os.environ.get("MAILCHIMP_API_KEY", None) +MAILCHIMP_SUBSCRIBE_LIST_ID = os.environ.get("MAILCHIMP_SUBSCRIBE_LIST_ID", None) -APPLICATION_REMINDER_PERIODS = ast.literal_eval(os.environ.get('APPLICATION_REMINDER_PERIODS', 'None')) -VOLUNTEER_RENEW_REMINDER_PERIODS = ast.literal_eval(os.environ.get('VOLUNTEER_RENEW_REMINDER_PERIODS', 'None')) -VOLUNTEER_REMINDER_OVERALL_PERIOD = VOLUNTEER_RENEW_REMINDER_PERIODS and timedelta(sum(VOLUNTEER_RENEW_REMINDER_PERIODS)) -VOLUNTEER_CONCLUDE_SURVEY_URL = os.environ.get('VOLUNTEER_CONCLUDE_SURVEY_URL', '') +APPLICATION_REMINDER_PERIODS = ast.literal_eval( + os.environ.get("APPLICATION_REMINDER_PERIODS", "None") +) +VOLUNTEER_RENEW_REMINDER_PERIODS = ast.literal_eval( + os.environ.get("VOLUNTEER_RENEW_REMINDER_PERIODS", "None") +) +VOLUNTEER_REMINDER_OVERALL_PERIOD = VOLUNTEER_RENEW_REMINDER_PERIODS and timedelta( + sum(VOLUNTEER_RENEW_REMINDER_PERIODS) +) +VOLUNTEER_CONCLUDE_SURVEY_URL = os.environ.get("VOLUNTEER_CONCLUDE_SURVEY_URL", "") -DLAB_PROJECT_ID = os.environ.get('DLAB_PROJECT_ID', None) +DLAB_PROJECT_ID = os.environ.get("DLAB_PROJECT_ID", None) -PAYPAL_ENDPOINT = os.environ.get('PAYPAL_ENDPOINT', '') -PAYPAL_PAYEE = os.environ.get('PAYPAL_PAYEE', '') +PAYPAL_ENDPOINT = os.environ.get("PAYPAL_ENDPOINT", "") +PAYPAL_PAYEE = os.environ.get("PAYPAL_PAYEE", "") -SPONSORS_METADATA = os.environ.get('SPONSORS_METADATA', '') +SPONSORS_METADATA = os.environ.get("SPONSORS_METADATA", "") -HEADER_ALERT = os.environ.get('HEADER_ALERT', '') +HEADER_ALERT = os.environ.get("HEADER_ALERT", "") -PROJECT_DESCRIPTION_EXAMPLE_URL = os.environ.get('PROJECT_DESCRIPTION_EXAMPLE_URL', '') -POSITION_DESCRIPTION_EXAMPLE_URL = os.environ.get('POSITION_DESCRIPTION_EXAMPLE_URL', '') +PROJECT_DESCRIPTION_EXAMPLE_URL = os.environ.get("PROJECT_DESCRIPTION_EXAMPLE_URL", "") +POSITION_DESCRIPTION_EXAMPLE_URL = os.environ.get( + "POSITION_DESCRIPTION_EXAMPLE_URL", "" +) -PRESS_LINKS = os.environ.get('PRESS_LINKS', '') +PRESS_LINKS = os.environ.get("PRESS_LINKS", "") -SECURE_SSL_REDIRECT = os.environ.get('DL_SECURE_SSL_REDIRECT', False) == 'True' +SECURE_SSL_REDIRECT = os.environ.get("DL_SECURE_SSL_REDIRECT", False) == "True" # Note: This environment variable should only be applied in Production -HOTJAR_APPLICATION_ID = os.environ.get('HOTJAR_APPLICATION_ID', '') +HOTJAR_APPLICATION_ID = os.environ.get("HOTJAR_APPLICATION_ID", "") -GOOGLE_PROPERTY_ID = os.environ.get('GOOGLE_PROPERTY_ID', '') -GOOGLE_ADS_ID = os.environ.get('GOOGLE_ADS_ID', '') -GOOGLE_TAGS_ID = os.environ.get('GOOGLE_TAGS_ID', '') -GOOGLE_CONVERSION_IDS = ast.literal_eval(os.environ.get('GOOGLE_CONVERSION_IDS', 'None')) +GOOGLE_PROPERTY_ID = os.environ.get("GOOGLE_PROPERTY_ID", "") +GOOGLE_ADS_ID = os.environ.get("GOOGLE_ADS_ID", "") +GOOGLE_TAGS_ID = os.environ.get("GOOGLE_TAGS_ID", "") +GOOGLE_CONVERSION_IDS = ast.literal_eval( + os.environ.get("GOOGLE_CONVERSION_IDS", "None") +) -#Google ReCaptcha keys - site key is exposed to the front end, secret is not -GR_SITEKEY = os.environ.get('GOOGLE_RECAPTCHA_SITE_KEY', '') -GR_SECRETKEY = os.environ.get('GOOGLE_RECAPTCHA_SECRET_KEY', '') +# Google ReCaptcha keys - site key is exposed to the front end, secret is not +GR_SITEKEY = os.environ.get("GOOGLE_RECAPTCHA_SITE_KEY", "") +GR_SECRETKEY = os.environ.get("GOOGLE_RECAPTCHA_SECRET_KEY", "") # Heap Analytics app id -HEAP_ANALYTICS_ID = os.environ.get('HEAP_ANALYTICS_ID', '') +HEAP_ANALYTICS_ID = os.environ.get("HEAP_ANALYTICS_ID", "") -STATIC_CDN_URL = os.environ.get('STATIC_CDN_URL', '') +STATIC_CDN_URL = os.environ.get("STATIC_CDN_URL", "") -HERE_CONFIG = os.environ.get('HERE_CONFIG', '') +HERE_CONFIG = os.environ.get("HERE_CONFIG", "") ENVIRONMENT_VARIABLE_WARNINGS = { - 'PRESS_LINKS': { - 'error': True, - 'message': 'Press page articles will not be shown.' + "PRESS_LINKS": {"error": True, "message": "Press page articles will not be shown."}, + "PROTOCOL_DOMAIN": { + "error": True, + "message": "Backend link generation will not work.", }, - 'PROTOCOL_DOMAIN': { - 'error': True, - 'message': 'Backend link generation will not work.' + "BOARD_OF_DIRECTORS": { + "error": False, + "message": "About Us page will not display correctly.", }, - 'BOARD_OF_DIRECTORS': { - 'error': False, - 'message': 'About Us page will not display correctly.' + "DLAB_PROJECT_ID": { + "error": False, + "message": "About Us page will not display correctly.", }, - 'DLAB_PROJECT_ID': { - 'error': False, - 'message': 'About Us page will not display correctly.' + "STATIC_CDN_URL": {"error": False, "message": "Static images will not be shown."}, + "PROJECT_DESCRIPTION_EXAMPLE_URL": { + "error": False, + "message": "Example url for project description will not be shown.", }, - 'STATIC_CDN_URL': { - 'error': False, - 'message': 'Static images will not be shown.' + "POSITION_DESCRIPTION_EXAMPLE_URL": { + "error": False, + "message": "Example url for position description will not be shown.", }, - 'PROJECT_DESCRIPTION_EXAMPLE_URL': { - 'error': False, - 'message': 'Example url for project description will not be shown.' + "S3_BUCKET": {"error": False, "message": "Saving images and files will not work."}, + "PAYPAL_ENDPOINT": {"error": False, "message": "Donations will not work."}, + "VOLUNTEER_RENEW_REMINDER_PERIODS": { + "error": False, + "message": "Needed to calculate volunteer renewal periods.", }, - 'POSITION_DESCRIPTION_EXAMPLE_URL': { - 'error': False, - 'message': 'Example url for position description will not be shown.' + "GR_SITEKEY": { + "error": True, + "message": "Contact Us page will not render correctly.", }, - 'S3_BUCKET': { - 'error': False, - 'message': 'Saving images and files will not work.' + "CONTACT_EMAIL": { + "error": False, + "message": "Contact Us form will not send messages.", }, - 'PAYPAL_ENDPOINT': { - 'error': False, - 'message': 'Donations will not work.' + "GITHUB_API_TOKEN": { + "error": False, + "message": "Github API key needed to raise rate limit for ingesting commit data", }, - 'VOLUNTEER_RENEW_REMINDER_PERIODS': { - 'error': False, - 'message': 'Needed to calculate volunteer renewal periods.' + "MAILCHIMP_API_KEY": { + "error": False, + "message": "Mailchimp API key needed to subscribe users to mailing list", }, - 'GR_SITEKEY': { - 'error': True, - 'message': 'Contact Us page will not render correctly.' + "GHOST_URL": { + "error": False, + "message": "Ghost url needed to display blog posts on site", }, - 'CONTACT_EMAIL': { - 'error': False, - 'message': 'Contact Us form will not send messages.' + "GHOST_CONTENT_API_KEY": { + "error": False, + "message": "Ghost content api key needed to display blog posts on site", }, - 'GITHUB_API_TOKEN': { - 'error': False, - 'message': 'Github API key needed to raise rate limit for ingesting commit data' - }, - 'MAILCHIMP_API_KEY': { - 'error': False, - 'message': 'Mailchimp API key needed to subscribe users to mailing list' - }, - 'GHOST_URL': { - 'error': False, - 'message': 'Ghost url needed to display blog posts on site' - }, - 'GHOST_CONTENT_API_KEY': { - 'error': False, - 'message': 'Ghost content api key needed to display blog posts on site' - }, - 'VIDEO_PAGES': { - 'error': False, - 'message': 'VIDEO_PAGES needed to show /videos/' - } + "VIDEO_PAGES": {"error": False, "message": "VIDEO_PAGES needed to show /videos/"}, } CSRF_COOKIE_SECURE = not DEBUG SESSION_COOKIE_SECURE = not DEBUG if not DEBUG: - CSRF_COOKIE_SAMESITE = 'None' - SESSION_COOKIE_SAMESITE = 'None' + CSRF_COOKIE_SAMESITE = "None" + SESSION_COOKIE_SAMESITE = "None" CSP_DEFAULT_SRC = ("'none'",) -CSP_STYLE_SRC = ("'self'", "'unsafe-inline'", 'fonts.googleapis.com', '*.fontawesome.com') -CSP_SCRIPT_SRC = ("'self'", "'unsafe-inline'", "'unsafe-eval'", '*.heapanalytics.com/', '*.google.com/', '*.gstatic.com', '*.googletagmanager.com', '*.google-analytics.com', '*.googleadservices.com', '*.doubleclick.net', '*.newrelic.com', '*.nr-data.net', '*.hotjar.com') -CSP_CONNECT_SRC = ("'self'", S3_BUCKET_URL, '*.qiqochat.com', 'qiqocableeu.herokuapp.com', '*.google-analytics.com', '*.nr-data.net', '*.hereapi.com', '*.hotjar.com') -CSP_FONT_SRC = ("'self'", 'fonts.googleapis.com', 'fonts.gstatic.com', 'use.fontawesome.com') -CSP_IMG_SRC = ("'self'", "data:", "blob:", "'unsafe-eval'", '*.cloudfront.net', '*.amazonaws.com', 'heapanalytics.com/', "*.google.com", '*.google-analytics.com', '*.googletagmanager.com', '*.paypal.com', '*.paypalobjects.com', '*.githubusercontent.com') +CSP_STYLE_SRC = ( + "'self'", + "'unsafe-inline'", + "fonts.googleapis.com", + "*.fontawesome.com", +) +CSP_SCRIPT_SRC = ( + "'self'", + "'unsafe-inline'", + "'unsafe-eval'", + "*.heapanalytics.com/", + "*.google.com/", + "*.gstatic.com", + "*.googletagmanager.com", + "*.google-analytics.com", + "*.googleadservices.com", + "*.doubleclick.net", + "*.newrelic.com", + "*.nr-data.net", + "*.hotjar.com", +) +CSP_CONNECT_SRC = ( + "'self'", + S3_BUCKET_URL, + "*.qiqochat.com", + "qiqocableeu.herokuapp.com", + "*.google-analytics.com", + "*.nr-data.net", + "*.hereapi.com", + "*.hotjar.com", +) +CSP_FONT_SRC = ( + "'self'", + "fonts.googleapis.com", + "fonts.gstatic.com", + "use.fontawesome.com", +) +CSP_IMG_SRC = ( + "'self'", + "data:", + "blob:", + "'unsafe-eval'", + "*.cloudfront.net", + "*.amazonaws.com", + "heapanalytics.com/", + "*.google.com", + "*.google-analytics.com", + "*.googletagmanager.com", + "*.paypal.com", + "*.paypalobjects.com", + "*.githubusercontent.com", +) -CSP_FRAME_ANCESTORS = os.environ.get('CSP_FRAME_ANCESTORS', None) +CSP_FRAME_ANCESTORS = os.environ.get("CSP_FRAME_ANCESTORS", None) if CSP_FRAME_ANCESTORS is not None: CSP_FRAME_ANCESTORS = ast.literal_eval(CSP_FRAME_ANCESTORS) -CSP_FRAME_SRC = os.environ.get('CSP_FRAME_SRC', None) +CSP_FRAME_SRC = os.environ.get("CSP_FRAME_SRC", None) if CSP_FRAME_SRC is not None: CSP_FRAME_SRC = ast.literal_eval(CSP_FRAME_SRC) -CORS_ALLOWED_ORIGIN_PATTERNS = os.environ.get('CORS_ALLOWED_ORIGIN_PATTERNS', None) +CORS_ALLOWED_ORIGIN_PATTERNS = os.environ.get("CORS_ALLOWED_ORIGIN_PATTERNS", None) if CORS_ALLOWED_ORIGIN_PATTERNS is not None: CORS_ALLOWED_ORIGIN_REGEXES = ast.literal_eval(CORS_ALLOWED_ORIGIN_PATTERNS) # Internationalization # https://docs.djangoproject.com/en/1.11/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = "en-us" -TIME_ZONE = 'UTC' +TIME_ZONE = "UTC" USE_I18N = True @@ -395,95 +456,98 @@ def read_connection_config(config): USE_TZ = True -PROJECTS_PER_PAGE = os.environ.get('PROJECTS_PER_PAGE', 20) +PROJECTS_PER_PAGE = os.environ.get("PROJECTS_PER_PAGE", 20) # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.11/howto/static-files/ -STATIC_URL = '/static/' -STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles') +STATIC_URL = "/static/" +STATIC_ROOT = os.path.join(PROJECT_ROOT, "staticfiles") LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse' - } - }, - 'handlers': { - 'custom_error_handler': { - 'class': 'democracylab.logging.CustomErrorHandler' - } + "version": 1, + "disable_existing_loggers": False, + "filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}}, + "handlers": { + "custom_error_handler": {"class": "democracylab.logging.CustomErrorHandler"} }, - 'loggers': { + "loggers": { # Override global logger - '': { - 'handlers': ['custom_error_handler'], - 'level': 'ERROR', - 'propagate': True - }, + "": {"handlers": ["custom_error_handler"], "level": "ERROR", "propagate": True}, }, } -DISALLOW_CRAWLING = os.environ.get('DISALLOW_CRAWLING', False) == 'True' +DISALLOW_CRAWLING = os.environ.get("DISALLOW_CRAWLING", False) == "True" -DL_PAGES_LAST_UPDATED_DATE = os.environ.get('DL_PAGES_LAST_UPDATED', '2019-12-05') +DL_PAGES_LAST_UPDATED_DATE = os.environ.get("DL_PAGES_LAST_UPDATED", "2019-12-05") SITE_LAST_UPDATED = parse(DL_PAGES_LAST_UPDATED_DATE) # https://docs.djangoproject.com/en/1.7/ref/settings/#silenced-system-checks SILENCED_SYSTEM_CHECKS = ["rest_framework.W001"] # How many of the most recent github commits to store per project. -MAX_COMMITS_PER_PROJECT = int(os.environ.get('MAX_COMMITS_PER_PROJECT', 30)) +MAX_COMMITS_PER_PROJECT = int(os.environ.get("MAX_COMMITS_PER_PROJECT", 30)) -BOARD_OF_DIRECTORS = os.environ.get('BOARD_OF_DIRECTORS', '') +BOARD_OF_DIRECTORS = os.environ.get("BOARD_OF_DIRECTORS", "") -FAVICON_PATH = os.environ.get('FAVICON_PATH', 'https://d1agxr2dqkgkuy.cloudfront.net/img/favicon.png') +FAVICON_PATH = os.environ.get( + "FAVICON_PATH", "https://d1agxr2dqkgkuy.cloudfront.net/img/favicon.png" +) -TEST_IFRAME_URL = os.environ.get('TEST_IFRAME_URL', 'about:blank') +TEST_IFRAME_URL = os.environ.get("TEST_IFRAME_URL", "about:blank") -QIQO_IFRAME_URL = os.environ.get('QIQO_IFRAME_URL', 'https://qiqochat.com/api/v1/iframe?&source[api_key]={api_key}&source_user_uuid={source_user_uuid}&qiqo_user_uuid={qiqo_user_uuid}&return_to="/breakout/2/HqWdBUwtmmzLsfPvyEXwmiRZw?embedded=true"') -QIQO_API_BASE_URL = os.environ.get('QIQO_API_BASE_URL', 'https://api.qiqochat.com/api/v1/') -QIQO_USERS_ENDPOINT = os.environ.get('QIQO_USERS_ENDPOINT', 'https://api.qiqochat.com/api/v1/users') -QIQO_API_KEY = os.environ.get('QIQO_API_KEY', 'democracylab') -QIQO_API_SECRET = os.environ.get('QIQO_API_SECRET', 'SECRET') -QIQO_CIRCLE_UUID = os.environ.get('QIQO_CIRCLE_UUID', 'nmitq') -QIQO_SIGNUP_TIMEOUT_SECONDS = int(os.environ.get('QIQO_SIGNUP_TIMEOUT_SECONDS', 5)) -QIQO_IMPERSONATION_ENABLED = os.environ.get('QIQO_IMPERSONATION_ENABLED', False) == 'True' +QIQO_IFRAME_URL = os.environ.get( + "QIQO_IFRAME_URL", + 'https://qiqochat.com/api/v1/iframe?&source[api_key]={api_key}&source_user_uuid={source_user_uuid}&qiqo_user_uuid={qiqo_user_uuid}&return_to="/breakout/2/HqWdBUwtmmzLsfPvyEXwmiRZw?embedded=true"', +) +QIQO_API_BASE_URL = os.environ.get( + "QIQO_API_BASE_URL", "https://api.qiqochat.com/api/v1/" +) +QIQO_USERS_ENDPOINT = os.environ.get( + "QIQO_USERS_ENDPOINT", "https://api.qiqochat.com/api/v1/users" +) +QIQO_API_KEY = os.environ.get("QIQO_API_KEY", "democracylab") +QIQO_API_SECRET = os.environ.get("QIQO_API_SECRET", "SECRET") +QIQO_CIRCLE_UUID = os.environ.get("QIQO_CIRCLE_UUID", "nmitq") +QIQO_SIGNUP_TIMEOUT_SECONDS = int(os.environ.get("QIQO_SIGNUP_TIMEOUT_SECONDS", 5)) +QIQO_IMPERSONATION_ENABLED = ( + os.environ.get("QIQO_IMPERSONATION_ENABLED", False) == "True" +) # Discovered breakage in v52.0, so beware moving away from SALESFORCE_API_VERSION v50.0 -SALESFORCE_API_VERSION = os.environ.get('SALESFORCE_API_VERSION', 50.0) -SALESFORCE_ENDPOINT = os.environ.get('SALESFORCE_ENDPOINT', '') -SALESFORCE_LOGIN_URL = os.environ.get('SALESFORCE_LOGIN_URL', '') -SALESFORCE_TOKEN_SUFFIX = os.environ.get('SALESFORCE_TOKEN_SUFFIX', '') -SALESFORCE_REDIRECT_URI = os.environ.get('SALESFORCE_REDIRECT_URI', '') -SALESFORCE_JWT = os.environ.get('SALESFORCE_JWT', '') +SALESFORCE_API_VERSION = os.environ.get("SALESFORCE_API_VERSION", 50.0) +SALESFORCE_ENDPOINT = os.environ.get("SALESFORCE_ENDPOINT", "") +SALESFORCE_LOGIN_URL = os.environ.get("SALESFORCE_LOGIN_URL", "") +SALESFORCE_TOKEN_SUFFIX = os.environ.get("SALESFORCE_TOKEN_SUFFIX", "") +SALESFORCE_REDIRECT_URI = os.environ.get("SALESFORCE_REDIRECT_URI", "") +SALESFORCE_JWT = os.environ.get("SALESFORCE_JWT", "") # Mark's Salesforce *USER* id (not the Contact id) -SALESFORCE_OWNER_ID = os.environ.get('SALESFORCE_OWNER_ID', '') +SALESFORCE_OWNER_ID = os.environ.get("SALESFORCE_OWNER_ID", "") -BLOG_URL = os.environ.get('BLOG_URL', 'https://blog.democracylab.org') +BLOG_URL = os.environ.get("BLOG_URL", "https://blog.democracylab.org") -EVENT_URL = os.environ.get('EVENT_URL', '') +EVENT_URL = os.environ.get("EVENT_URL", "") -GDAL_LIBRARY_PATH = os.environ.get('GDAL_LIBRARY_PATH', '') -GEOS_LIBRARY_PATH = os.environ.get('GEOS_LIBRARY_PATH', '') +GDAL_LIBRARY_PATH = os.environ.get("GDAL_LIBRARY_PATH", "") +GEOS_LIBRARY_PATH = os.environ.get("GEOS_LIBRARY_PATH", "") -DONATE_PAGE_BLURB = os.environ.get('DONATE_PAGE_BLURB', '') +DONATE_PAGE_BLURB = os.environ.get("DONATE_PAGE_BLURB", "") # Video Link -VIDEO_PAGES = os.environ.get('VIDEO_PAGES', None) +VIDEO_PAGES = os.environ.get("VIDEO_PAGES", None) if VIDEO_PAGES is not None: VIDEO_PAGES = ast.literal_eval(VIDEO_PAGES) # Ghost blog configs -GHOST_URL = os.environ.get('GHOST_URL', 'https://blog.democracylab.org') -GHOST_CONTENT_API_KEY = os.environ.get('GHOST_CONTENT_API_KEY', '52d832a0619aebf848c9264829') +GHOST_URL = os.environ.get("GHOST_URL", "https://blog.democracylab.org") +GHOST_CONTENT_API_KEY = os.environ.get( + "GHOST_CONTENT_API_KEY", "52d832a0619aebf848c9264829" +) if GHOST_URL: CSP_CONNECT_SRC = CSP_CONNECT_SRC + (GHOST_URL,) -MALICIOUS_URL_PATTERNS = os.environ.get('MALICIOUS_URL_PATTERNS', None) -MALICIOUS_FWD_PATTERNS = os.environ.get('MALICIOUS_FWD_PATTERNS', None) +MALICIOUS_URL_PATTERNS = os.environ.get("MALICIOUS_URL_PATTERNS", None) +MALICIOUS_FWD_PATTERNS = os.environ.get("MALICIOUS_FWD_PATTERNS", None) -PASSWORD_RESET_TIMEOUT_DAYS = os.environ.get('PASSWORD_RESET_TIMEOUT_DAYS', 7) \ No newline at end of file +PASSWORD_RESET_TIMEOUT_DAYS = os.environ.get("PASSWORD_RESET_TIMEOUT_DAYS", 7) diff --git a/requirements.txt b/requirements.txt index ff31a78d9..44b1060be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ django-registration==3.1.2 django-rq==2.4.1 django-s3direct==0.4.2 django-storages==1.5.1 -django-taggit==2.1 +django-taggit==4.0 django-timezone-field==4.2.3 django-debreach==2.0.1 djangorestframework==3.14.0