From f911345984952632dd99b847c3a5fc44964811ea Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 22 Feb 2023 17:03:14 -0600 Subject: [PATCH] Fix prev commit --- judge/models/problem.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/judge/models/problem.py b/judge/models/problem.py index 875b072..59017f9 100644 --- a/judge/models/problem.py +++ b/judge/models/problem.py @@ -559,9 +559,10 @@ 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 - ) + 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: