Add help text and trans
This commit is contained in:
parent
a1bcc2cb46
commit
8ba39a1f97
6 changed files with 85 additions and 22 deletions
|
@ -6,18 +6,22 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0123_auto_20220502_2356'),
|
||||
("judge", "0123_auto_20220502_2356"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='problemdata',
|
||||
name='fileio_input',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='input file name'),
|
||||
model_name="problemdata",
|
||||
name="fileio_input",
|
||||
field=models.TextField(
|
||||
blank=True, null=True, verbose_name="input file name"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='problemdata',
|
||||
name='fileio_output',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='output file name'),
|
||||
model_name="problemdata",
|
||||
name="fileio_output",
|
||||
field=models.TextField(
|
||||
blank=True, null=True, verbose_name="output file name"
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
33
judge/migrations/0125_auto_20220602_1216.py
Normal file
33
judge/migrations/0125_auto_20220602_1216.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 2.2.25 on 2022-06-02 05:16
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("judge", "0124_auto_20220602_1116"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="problemdata",
|
||||
name="fileio_input",
|
||||
field=models.TextField(
|
||||
blank=True,
|
||||
help_text="Leave empty for stdin",
|
||||
null=True,
|
||||
verbose_name="input file name",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="problemdata",
|
||||
name="fileio_output",
|
||||
field=models.TextField(
|
||||
blank=True,
|
||||
help_text="Leave empty for stdout",
|
||||
null=True,
|
||||
verbose_name="output file name",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -106,10 +106,16 @@ class ProblemData(models.Model):
|
|||
validators=[FileExtensionValidator(allowed_extensions=["cpp"])],
|
||||
)
|
||||
fileio_input = models.TextField(
|
||||
verbose_name=_("input file name"), blank=True, null=True
|
||||
verbose_name=_("input file name"),
|
||||
blank=True,
|
||||
null=True,
|
||||
help_text=_("Leave empty for stdin"),
|
||||
)
|
||||
fileio_output = models.TextField(
|
||||
verbose_name=_("output file name"), blank=True, null=True
|
||||
verbose_name=_("output file name"),
|
||||
blank=True,
|
||||
null=True,
|
||||
help_text=_("Leave empty for stdout"),
|
||||
)
|
||||
|
||||
__original_zipfile = None
|
||||
|
|
|
@ -542,8 +542,10 @@ class ProblemSubmissionsBase(SubmissionsListBase):
|
|||
if self.check_contest_in_access_check:
|
||||
self.access_check_contest(request)
|
||||
else:
|
||||
is_own = hasattr(self, 'is_own') and self.is_own
|
||||
if not is_own and not self.problem.is_accessible_by(request.user, request.in_contest_mode):
|
||||
is_own = hasattr(self, "is_own") and self.is_own
|
||||
if not is_own and not self.problem.is_accessible_by(
|
||||
request.user, request.in_contest_mode
|
||||
):
|
||||
raise Http404()
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
@ -805,7 +807,9 @@ class UserContestSubmissionsAjax(UserContestSubmissions):
|
|||
context["contest"] = self.contest
|
||||
context["problem"] = self.problem
|
||||
context["profile"] = self.profile
|
||||
context["profile_id"] = self.request.profile.id if self.request.profile else None
|
||||
context["profile_id"] = (
|
||||
self.request.profile.id if self.request.profile else None
|
||||
)
|
||||
|
||||
contest_problem = self.contest.contest_problems.get(problem=self.problem)
|
||||
for s in context["submissions"]:
|
||||
|
@ -823,4 +827,4 @@ class UserContestSubmissionsAjax(UserContestSubmissions):
|
|||
try:
|
||||
return super(UserContestSubmissionsAjax, self).get(request, *args, **kwargs)
|
||||
except Http404:
|
||||
return HttpResponse(_("You don't have permission to access."))
|
||||
return HttpResponse(_("You don't have permission to access."))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue