Change pdf description path when code changes

This commit is contained in:
cuom1999 2023-02-22 16:49:30 -06:00
parent 6b2bd7c550
commit 82a6f910e3
2 changed files with 3 additions and 1 deletions

View file

@ -559,6 +559,9 @@ class Problem(models.Model):
return result return result
def save(self, *args, **kwargs): 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) super(Problem, self).save(*args, **kwargs)
if self.code != self.__original_code: if self.code != self.__original_code:
try: try:

View file

@ -63,7 +63,6 @@ from judge.models import (
Submission, Submission,
SubmissionSource, SubmissionSource,
Organization, Organization,
VolunteerProblemVote,
Profile, Profile,
LanguageTemplate, LanguageTemplate,
) )