From 9758546377ba73bcaa4091d1601b1274e105fd0a Mon Sep 17 00:00:00 2001 From: Jacob Adams Date: Mon, 23 Dec 2019 21:20:00 -0500 Subject: [PATCH 1/5] Document environment variables used --- docs/environment.md | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 docs/environment.md diff --git a/docs/environment.md b/docs/environment.md new file mode 100644 index 0000000..6a780bb --- /dev/null +++ b/docs/environment.md @@ -0,0 +1,50 @@ +# Environment Variables + +## Production + +`PRODUCTION` set to `true` for sane defaults when running in production. + +`DEBUG` enables [Django debug mode](https://docs.djangoproject.com/en/2.0/ref/settings/#std:setting-DEBUG) . +Set when `PRODUCTION` is not set. + +`SECRET_KEY` a random value for cryptographic signing by [Django](https://docs.djangoproject.com/en/2.0/ref/settings/#std:setting-SECRET_KEY) . + +`REGISTRATION_TOKEN` a random string used to prevent registration by random people. +If set, users cannot access the registration page without knowing the token. +It must be set as the GET parameter `token` when opening the registration page. + +E.g. if the token for `hackerforce.example.com` is `mytoken`, then new users +would register at `hackerforce.example.com/register/?token=mytoken` . + +If not set, anyone can register from the home page. + +## Emails + +`FROM_EMAIL` the address emails HackerForce sends appear to come from. + +`REPLY_TO_EMAIL` the address responses to your emails are sent to. + +`BCC_EMAIL` An address all emails you send are sent to. + +### Sending Emails + +`SENDGRID_API_KEY` set if you want to send emails through [SendGrid](https://sendgrid.com/) . + +`AWS_ACCESS_KEY_ID` set if you want to send emails through [AWS Simple Email Service](https://aws.amazon.com/ses/) . + +## Database + +`DATABASE_URL` the location of the database used by HackerForce. +Consumed by [dj_database_url](https://github.com/jacobian/dj-database-url) . + +## Sponsorship Packet + +`SPONSORSHIP_PACKET_URL` +The URL for the sponsorship packet, to download if `SPONSORSHIP_PACKET_FILE` +does not exist in the filesystem. + +`SPONSORSHIP_PACKET_FILE` +The local name of the sponsorship packet, to be stored in the website/static +folder. If this file exists, it will be used. Otherwise, it will be +re-downloaded from `SPONSORSHIP_PACKET_URL`. +Must be set regardless of whether `SPONSORSHIP_PACKET_URL` is set. From dfb6ac1304a7db21853765de9da795e8e9ef20bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2019 00:11:59 +0000 Subject: [PATCH 2/5] Bump django from 2.2.4 to 2.2.8 Bumps [django](https://github.com/django/django) from 2.2.4 to 2.2.8. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/2.2.4...2.2.8) Signed-off-by: dependabot[bot] --- Pipfile.lock | 80 +++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 9375688..ef65198 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -32,10 +32,10 @@ }, "certifi": { "hashes": [ - "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", - "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695" + "sha256:017c25db2a153ce562900032d5bc68e9f191e44e9a0f762f373977de9df1fbb3", + "sha256:25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f" ], - "version": "==2019.6.16" + "version": "==2019.11.28" }, "chardet": { "hashes": [ @@ -53,11 +53,11 @@ }, "django": { "hashes": [ - "sha256:16a5d54411599780ac9dfe3b9b38f90f785c51259a584e0b24b6f14a7f69aae8", - "sha256:9a2f98211ab474c710fcdad29c82f30fc14ce9917c7a70c3682162a624de4035" + "sha256:a4ad4f6f9c6a4b7af7e2deec8d0cbff28501852e5010d6c2dc695d3d1fae7ca0", + "sha256:fa98ec9cc9bf5d72a08ebf3654a9452e761fbb8566e3f80de199cbc15477e891" ], "index": "pypi", - "version": "==2.2.4" + "version": "==2.2.8" }, "django-ckeditor": { "hashes": [ @@ -146,9 +146,9 @@ }, "future": { "hashes": [ - "sha256:67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8" + "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d" ], - "version": "==0.17.1" + "version": "==0.18.2" }, "gunicorn": { "hashes": [ @@ -167,10 +167,10 @@ }, "jinja2": { "hashes": [ - "sha256:065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013", - "sha256:14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b" + "sha256:74320bb91f31270f9551d46522e33af46a80c3d619f4a4bf42b3164d30b5911f", + "sha256:9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de" ], - "version": "==2.10.1" + "version": "==2.10.3" }, "markupsafe": { "hashes": [ @@ -215,19 +215,21 @@ }, "psycopg2": { "hashes": [ - "sha256:128d0fa910ada0157bba1cb74a9c5f92bb8a1dca77cf91a31eb274d1f889e001", - "sha256:227fd46cf9b7255f07687e5bde454d7d67ae39ca77e170097cdef8ebfc30c323", - "sha256:2315e7f104681d498ccf6fd70b0dba5bce65d60ac92171492bfe228e21dcc242", - "sha256:4b5417dcd2999db0f5a891d54717cfaee33acc64f4772c4bc574d4ff95ed9d80", - "sha256:640113ddc943522aaf71294e3f2d24013b0edd659b7820621492c9ebd3a2fb0b", - "sha256:897a6e838319b4bf648a574afb6cabcb17d0488f8c7195100d48d872419f4457", - "sha256:8dceca81409898c870e011c71179454962dec152a1a6b86a347f4be74b16d864", - "sha256:b1b8e41da09a0c3ef0b3d4bb72da0dde2abebe583c1e8462973233fd5ad0235f", - "sha256:cb407fccc12fc29dc331f2b934913405fa49b9b75af4f3a72d0f50f57ad2ca23", - "sha256:d3a27550a8185e53b244ad7e79e307594b92fede8617d80200a8cce1fba2c60f", - "sha256:f0e6b697a975d9d3ccd04135316c947dd82d841067c7800ccf622a8717e98df1" - ], - "version": "==2.8.3" + "sha256:4212ca404c4445dc5746c0d68db27d2cbfb87b523fe233dc84ecd24062e35677", + "sha256:47fc642bf6f427805daf52d6e52619fe0637648fe27017062d898f3bf891419d", + "sha256:72772181d9bad1fa349792a1e7384dde56742c14af2b9986013eb94a240f005b", + "sha256:8396be6e5ff844282d4d49b81631772f80dabae5658d432202faf101f5283b7c", + "sha256:893c11064b347b24ecdd277a094413e1954f8a4e8cdaf7ffbe7ca3db87c103f0", + "sha256:92a07dfd4d7c325dd177548c4134052d4842222833576c8391aab6f74038fc3f", + "sha256:965c4c93e33e6984d8031f74e51227bd755376a9df6993774fd5b6fb3288b1f4", + "sha256:9ab75e0b2820880ae24b7136c4d230383e07db014456a476d096591172569c38", + "sha256:b0845e3bdd4aa18dc2f9b6fb78fbd3d9d371ad167fd6d1b7ad01c0a6cdad4fc6", + "sha256:dca2d7203f0dfce8ea4b3efd668f8ea65cd2b35112638e488a4c12594015f67b", + "sha256:ed686e5926929887e2c7ae0a700e32c6129abb798b4ad2b846e933de21508151", + "sha256:ef6df7e14698e79c59c7ee7cf94cd62e5b869db369ed4b1b8f7b729ea825712a", + "sha256:f898e5cc0a662a9e12bde6f931263a1bbd350cfb18e1d5336a12927851825bb6" + ], + "version": "==2.8.4" }, "psycopg2-binary": { "hashes": [ @@ -265,17 +267,17 @@ }, "python-dateutil": { "hashes": [ - "sha256:7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb", - "sha256:c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e" + "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", + "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], - "version": "==2.8.0" + "version": "==2.8.1" }, "pytz": { "hashes": [ - "sha256:26c0b32e437e54a18161324a2fca3c4b9846b74a8dccddd843113109e1116b32", - "sha256:c894d57500a4cd2d5c71114aaab77dbab5eabd9022308ce5ac9bb93a60a6f0c7" + "sha256:1c557d7d0e871de1f5ccd5833f60fb2550652da6be2693c1e02300743d21500d", + "sha256:b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be" ], - "version": "==2019.2" + "version": "==2019.3" }, "requests": { "hashes": [ @@ -287,10 +289,10 @@ }, "six": { "hashes": [ - "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", - "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" + "sha256:1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd", + "sha256:30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66" ], - "version": "==1.12.0" + "version": "==1.13.0" }, "sqlparse": { "hashes": [ @@ -308,17 +310,17 @@ }, "urllib3": { "hashes": [ - "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", - "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" + "sha256:a8a318824cc77d1fd4b2bec2ded92646630d7fe8619497b142c84a9e6f5a7293", + "sha256:f3c5fd51747d450d4dcf6f923c81f78f811aab8205fda64b0aba34a4e48b0745" ], - "version": "==1.25.3" + "version": "==1.25.7" }, "whitenoise": { "hashes": [ - "sha256:59d880d25d0e90bcc6554fe0504a11195bd2e59b3d690b6fb42a8040d4e67ef5", - "sha256:c9b7c47fdc1dba4d37bf2787a01a844dc7a521e174fcd22a2d429e0be65e1782" + "sha256:22f79cf8f1f509639330f93886acaece8ec5ac5e9600c3b981d33c34e8a42dfd", + "sha256:6dfea214b7c12efd689007abf9afa87a426586e9dbc051873ad2c8e535e2a1ac" ], - "version": "==4.1.3" + "version": "==4.1.4" } }, "develop": {} From 37b6e53b553127004016cd6795ed446a4752c980 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 20 Dec 2020 15:34:20 -0500 Subject: [PATCH 3/5] add assigned status to model --- hackathons/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hackathons/models.py b/hackathons/models.py index 059a2f5..c248350 100644 --- a/hackathons/models.py +++ b/hackathons/models.py @@ -61,6 +61,7 @@ class Meta: class Sponsorship(models.Model): + ASSIGNED = "assigned" CONTACTED = "contacted" RESPONDED = "responded" CONFIRMED = "confirmed" @@ -68,6 +69,7 @@ class Sponsorship(models.Model): GHOSTED = "ghosted" PAID = "paid" STATUSES = ( + (ASSIGNED, "Assigned"), (CONTACTED, "Contacted"), (RESPONDED, "Responded"), (CONFIRMED, "Confirmed"), From 40f41c97036cd04f424daf555cf9f612008293d9 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 20 Dec 2020 15:45:16 -0500 Subject: [PATCH 4/5] Update views, templates, etc. to reflect existence of Sponsorship.ASSIGNED --- dashboard/views.py | 2 +- hackathons/templates/cards/sponsorship_status.html | 2 ++ hackathons/views/sponsorships.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dashboard/views.py b/dashboard/views.py index 3a21929..6e5f54c 100644 --- a/dashboard/views.py +++ b/dashboard/views.py @@ -100,7 +100,7 @@ def gen_sponsorship_chart(sponsorships, hackathon): for sp in sponsorships: if sp.status in [Sponsorship.CONFIRMED, Sponsorship.PAID]: confirmed_count += 1 - elif sp.status in [Sponsorship.CONTACTED, Sponsorship.RESPONDED]: + elif sp.status in [Sponsorship.ASSIGNED, Sponsorship.CONTACTED, Sponsorship.RESPONDED]: progress_count += 1 elif sp.status in [Sponsorship.DENIED, Sponsorship.GHOSTED]: dead_count += 1 diff --git a/hackathons/templates/cards/sponsorship_status.html b/hackathons/templates/cards/sponsorship_status.html index 1eb4924..177de6b 100644 --- a/hackathons/templates/cards/sponsorship_status.html +++ b/hackathons/templates/cards/sponsorship_status.html @@ -1,6 +1,8 @@ {% if not sponsorship %} Uncontacted +{% elif sponsorship.status == 'assigned' %} + Assigned {% elif sponsorship.status == 'contacted' %} Contacted {% elif sponsorship.status == 'responded' %} diff --git a/hackathons/views/sponsorships.py b/hackathons/views/sponsorships.py index 8428175..acd8a52 100644 --- a/hackathons/views/sponsorships.py +++ b/hackathons/views/sponsorships.py @@ -80,7 +80,7 @@ def fake_sponsorship(company): return [Sponsorship(pk=0, company=c, tier=None, contribution=0) for c in company] confirmed = sponsorship_wrapper("confirmed", [Sponsorship.CONFIRMED, Sponsorship.PAID]) - in_progress = sponsorship_wrapper("in_progress", [Sponsorship.CONTACTED, Sponsorship.RESPONDED]) + in_progress = sponsorship_wrapper("in_progress", [Sponsorship.ASSIGNED, Sponsorship.CONTACTED, Sponsorship.RESPONDED]) dead = sponsorship_wrapper("dead", [Sponsorship.GHOSTED, Sponsorship.DENIED]) uncontacted = company_wrapper("uncontacted") From 282ae133f7923a39b2d35373eb5574f86cd1754e Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 20 Dec 2020 15:50:22 -0500 Subject: [PATCH 5/5] Change sponsorship "Mark Contacted" to "Start Tracking" --- hackathons/templates/cards/sponsorship_table.html | 2 +- hackathons/templates/sponsorship_detail.html | 4 ++-- hackathons/templates/sponsorships_summary.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hackathons/templates/cards/sponsorship_table.html b/hackathons/templates/cards/sponsorship_table.html index e0f75f9..5050fd8 100644 --- a/hackathons/templates/cards/sponsorship_table.html +++ b/hackathons/templates/cards/sponsorship_table.html @@ -104,7 +104,7 @@

{{ card_title }}

{% if faked %} - Mark Contacted + Start Tracking {% else %} diff --git a/hackathons/templates/sponsorship_detail.html b/hackathons/templates/sponsorship_detail.html index 316d894..061b4be 100644 --- a/hackathons/templates/sponsorship_detail.html +++ b/hackathons/templates/sponsorship_detail.html @@ -19,7 +19,7 @@

{{ company.name }}

{% else %}
{% endif %} @@ -34,7 +34,7 @@

Status:  
This company has not been contacted for the current hackathon.
- Press "Mark Contacted" to begin tracking this company as a potential sponsor. + Press "Start Tracking" to begin tracking this company as a potential sponsor.
{% elif no_contacted_employees %}
diff --git a/hackathons/templates/sponsorships_summary.html b/hackathons/templates/sponsorships_summary.html index 756aee8..a6287f0 100644 --- a/hackathons/templates/sponsorships_summary.html +++ b/hackathons/templates/sponsorships_summary.html @@ -55,7 +55,7 @@ {% if faked %} - Mark Contacted + Start Tracking {% else %}