From 82a6f910e3fffbf600dbb73c87a802a6135273a9 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 22 Feb 2023 16:49:30 -0600 Subject: [PATCH] Change pdf description path when code changes --- judge/models/problem.py | 3 +++ judge/views/problem.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/judge/models/problem.py b/judge/models/problem.py index b8e18da..875b072 100644 --- a/judge/models/problem.py +++ b/judge/models/problem.py @@ -559,6 +559,9 @@ class Problem(models.Model): return result def save(self, *args, **kwargs): + self.pdf_description.name = problem_directory_file_helper( + self.code, self.pdf_description.name + ) super(Problem, self).save(*args, **kwargs) if self.code != self.__original_code: try: diff --git a/judge/views/problem.py b/judge/views/problem.py index 807fcc2..dde3acf 100644 --- a/judge/views/problem.py +++ b/judge/views/problem.py @@ -63,7 +63,6 @@ from judge.models import ( Submission, SubmissionSource, Organization, - VolunteerProblemVote, Profile, LanguageTemplate, )