-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from front-seat/staging
Finalize changes to support 1-in-N competitions
- Loading branch information
Showing
25 changed files
with
775 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
BASE_URL = os.environ["BASE_URL"] # Of the form "https://www.voterbowl.org" | ||
BASE_HOST = BASE_URL.split("://")[1] | ||
if not DEBUG and not BASE_URL.startswith("https://"): | ||
raise ValueError("BASE_URL must be HTTPS in production") | ||
if BASE_URL.endswith("/"): | ||
|
@@ -50,6 +51,7 @@ | |
"django.contrib.sessions", | ||
"django.contrib.messages", | ||
"django.contrib.staticfiles", | ||
"django.contrib.humanize", | ||
"django_browser_reload", | ||
"django_htmx", | ||
"server.vb", | ||
|
@@ -196,19 +198,12 @@ | |
EMAIL_USE_TLS = os.getenv("EMAIL_USE_TLS", "false").lower() == "true" | ||
EMAIL_USE_SSL = os.getenv("EMAIL_USE_SSL", "false").lower() == "true" | ||
|
||
# Special debug tool: emails matching this pattern will be sent to the | ||
# debug email address instead of the actual recipient. This is useful for | ||
# testing email functionality without spamming real users. | ||
# | ||
# For instance, if DEBUG_EMAIL_STARTSWITH is set to "frontseat@", | ||
# then any email sent to "[email protected]" will instead be sent to | ||
# DEBUG_EMAIL_TO. | ||
DEBUG_EMAIL_STARTSWITH = os.getenv("DEBUG_EMAIL_STARTSWITH", None) | ||
# Special debug tool: emails matching the pattern | ||
# frontseat-<digits>@ will be sent to DEBUG_EMAIL_TO | ||
# instead of the actual recipient. This is useful for testing email | ||
# functionality without spamming real users. | ||
DEBUG_EMAIL_REGEX = r"^frontseat-[a-zA-Z0-9]+@" | ||
DEBUG_EMAIL_TO = os.getenv("DEBUG_EMAIL_TO", None) | ||
if not DEBUG_EMAIL_STARTSWITH or not DEBUG_EMAIL_TO: | ||
DEBUG_EMAIL_STARTSWITH = None | ||
DEBUG_EMAIL_TO = None | ||
|
||
|
||
# ---------------------------------------------------------------------------- | ||
# Logging settings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 5.0.3 on 2024-04-24 23:56 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('vb', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameModel( | ||
old_name='GiftCard', | ||
new_name='ContestEntry', | ||
), | ||
migrations.AddField( | ||
model_name='contest', | ||
name='in_n', | ||
field=models.IntegerField(default=1, help_text='1 in_n students will win a gift card.'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 5.0.3 on 2024-04-25 00:19 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('vb', '0002_rename_gift_card'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='contestentry', | ||
name='amount', | ||
field=models.IntegerField(default=0, help_text='The USD amount of the gift card. 0 means no gift card.'), | ||
), | ||
migrations.AlterField( | ||
model_name='contestentry', | ||
name='creation_request_id', | ||
field=models.CharField(blank=True, default='', help_text='The creation code for the gift card, if a prize was won..', max_length=255), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 5.0.3 on 2024-04-25 16:12 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('vb', '0003_allow_for_no_prize'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='contestentry', | ||
name='created_at', | ||
field=models.DateTimeField(auto_now_add=True, db_index=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 5.0.3 on 2024-04-25 18:40 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('vb', '0004_index_contest_entry_times'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='contestentry', | ||
name='contest', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contest_entries', to='vb.contest'), | ||
), | ||
migrations.AlterField( | ||
model_name='contestentry', | ||
name='student', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='contest_entries', to='vb.student'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 5.0.3 on 2024-04-25 18:57 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('vb', '0005_rename_related_fields'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='contestentry', | ||
options={'verbose_name_plural': 'Contest entries'}, | ||
), | ||
] |
Oops, something went wrong.