Drop output_prefix_override and use show_testcases

This commit is contained in:
cuom1999 2023-08-25 18:12:53 -05:00
parent 97d0239963
commit 8f046c59c1
8 changed files with 61 additions and 16 deletions

View file

@ -772,12 +772,9 @@ class ContestProblem(models.Model):
partial = models.BooleanField(default=True, verbose_name=_("partial"))
is_pretested = models.BooleanField(default=False, verbose_name=_("is pretested"))
order = models.PositiveIntegerField(db_index=True, verbose_name=_("order"))
output_prefix_override = models.IntegerField(
help_text=_("0 to not show testcases, 1 to show"),
show_testcases = models.BooleanField(
verbose_name=_("visible testcases"),
null=True,
blank=True,
default=0,
default=False,
)
max_submissions = models.IntegerField(
help_text=_(

View file

@ -109,6 +109,13 @@ class Organization(models.Model):
"Organization membership test must be Profile or primany key"
)
def delete(self, *args, **kwargs):
contests = self.contest_set
for contest in contests.all():
if contest.organizations.count() == 1:
contest.delete()
super().delete(*args, **kwargs)
def __str__(self):
return self.name