Previously we had a lot of hardcoded contest information in the templates. Name, ruleset and number of contest are now all taken from the currently active contest and rendered into the templates. Instead of an URL containing the current contest name, we just use a generic /contest/. The API will no longer use "the contest with id=1", but the currently active contest as well. The currently active contest is - for now - the contest with the latest deadline.cleanup-and-fixes-2022
parent
7ae53b6150
commit
1f93f9e7bd
@ -0,0 +1,7 @@
|
||||
from .models import Contest
|
||||
|
||||
|
||||
def current_contest(self):
|
||||
return {
|
||||
'current_contest': Contest.get_current_contest(),
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
# Generated by Django 4.0.1 on 2022-01-22 17:52
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contest', '0021_alter_qso_otherno_alter_qso_ownno_alter_user_dncall_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='contest',
|
||||
name='contestNo',
|
||||
field=models.IntegerField(default=1, help_text='Running number of contest (for vanity reasons)', validators=[django.core.validators.MinValueValidator(1)]),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.0.1 on 2022-01-22 17:56
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contest', '0022_contest_contestno'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='contest',
|
||||
name='rulesetLink',
|
||||
field=models.TextField(default='', help_text='URL to the ruleset pdf for this contest'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
Loading…
Reference in new issue