Drop output_prefix_override and use show_testcases
This commit is contained in:
parent
97d0239963
commit
8f046c59c1
8 changed files with 61 additions and 16 deletions
30
judge/migrations/0164_show_testcase.py
Normal file
30
judge/migrations/0164_show_testcase.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Generated by Django 3.2.18 on 2023-08-25 23:03
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def migrate_show_testcases(apps, schema_editor):
|
||||
ContestProblem = apps.get_model("judge", "ContestProblem")
|
||||
|
||||
for c in ContestProblem.objects.all():
|
||||
if c.output_prefix_override == 1:
|
||||
c.show_testcases = True
|
||||
c.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("judge", "0163_email_change"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="contestproblem",
|
||||
name="show_testcases",
|
||||
field=models.BooleanField(default=False, verbose_name="visible testcases"),
|
||||
),
|
||||
migrations.RunPython(
|
||||
migrate_show_testcases, migrations.RunPython.noop, atomic=True
|
||||
),
|
||||
]
|
17
judge/migrations/0165_drop_output_prefix_override.py
Normal file
17
judge/migrations/0165_drop_output_prefix_override.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 3.2.18 on 2023-08-25 23:11
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("judge", "0164_show_testcase"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="contestproblem",
|
||||
name="output_prefix_override",
|
||||
),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue