Skip to content

Commit

Permalink
Fix file url issue by precessing reportversion files
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepsajan0 committed Nov 20, 2024
1 parent 533e94f commit ac7c188
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hypha/apply/projects/forms/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ def save(self, commit=True, form_fields=dict):

is_draft = "save" in self.data
version = ReportVersion.objects.create(
report=self.instance,
report=instance,
# Save a ReportVersion first then edit/update the form_data below.
form_data=instance.form_data,
submitted=timezone.now(),
draft=is_draft,
author=self.user,
)
version.process_file_data(self.cleaned_data["form_data"])
version.save()

if is_draft:
instance.draft = version
Expand Down

0 comments on commit ac7c188

Please sign in to comment.