From a4b06a354c5c0c26e1eab62cf75061e90bed2c2c Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Sun, 12 Mar 2023 01:57:50 -0600 Subject: [PATCH] Fix pdf_description save --- judge/models/problem.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/judge/models/problem.py b/judge/models/problem.py index 59017f9..76eca0a 100644 --- a/judge/models/problem.py +++ b/judge/models/problem.py @@ -559,10 +559,6 @@ class Problem(models.Model): return result def save(self, *args, **kwargs): - if self.pdf_description: - 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: @@ -571,6 +567,10 @@ class Problem(models.Model): pass else: problem_data._update_code(self.__original_code, self.code) + if self.pdf_description: + self.pdf_description.name = problem_directory_file_helper( + self.code, self.pdf_description.name + ) save.alters_data = True