Fix pdf_description save
This commit is contained in:
parent
195450ebc3
commit
a4b06a354c
1 changed files with 4 additions and 4 deletions
|
@ -559,10 +559,6 @@ class Problem(models.Model):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
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)
|
super(Problem, self).save(*args, **kwargs)
|
||||||
if self.code != self.__original_code:
|
if self.code != self.__original_code:
|
||||||
try:
|
try:
|
||||||
|
@ -571,6 +567,10 @@ class Problem(models.Model):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
problem_data._update_code(self.__original_code, self.code)
|
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
|
save.alters_data = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue