Skip to content

Commit

Permalink
save method was needed in render_files method
Browse files Browse the repository at this point in the history
  • Loading branch information
ramibch committed Dec 29, 2023
1 parent 4793820 commit f24d9a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/models/cvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def render_files(self):
self.image_time = time.time() - pdf_end
self.rendering_time = self.image_time + self.pdf_time

self.save()

return self

@classmethod
Expand All @@ -104,9 +106,9 @@ def crete_cvs_from_profile_templates(cls):

for tex in Tex.objects.filter(active=True):
for profile in Profile.objects.filter(category="template"):
obj = cls.objects.create(profile=profile, tex=tex, auto_created=True)
obj.render_files()
print(f"✅ {obj} created.")
cv = cls.objects.create(profile=profile, tex=tex, auto_created=True)
cv.render_files()
print(f"✅ {cv} created.")

def __str__(self) -> str:
return f"CV ({self.profile.fullname} {self.tex})"
Expand Down

0 comments on commit f24d9a6

Please sign in to comment.