Skip to content

Commit

Permalink
Merge pull request #619 from DH-IT-Portal-Development/acceptation
Browse files Browse the repository at this point in the history
Merge hotfix to master
  • Loading branch information
tymees authored Mar 4, 2024
2 parents b98c22d + 008206b commit 9c71bf6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions proposals/views/proposal_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,16 @@ class ProposalUpdateDataManagement(GroupRequiredMixin, generic.UpdateView):
form_class = ProposalUpdateDataManagementForm
group_required = settings.GROUP_SECRETARY

def form_valid(self, form):
ret = super().form_valid(form)
# Always regenerate the PDF after updating the DMP
# This is necessary, as the canonical PDF protection might already
# have kicked in if the secretary changes the documents later than
# we initially expected.
self.object.generate_pdf(force_overwrite=True)

return ret

def get_success_url(self):
"""Continue to the URL specified in the 'next' POST parameter"""
return reverse('reviews:detail', args=[self.object.latest_review().pk])
Expand Down
10 changes: 10 additions & 0 deletions studies/views/study_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ class StudyUpdateAttachments(braces.GroupRequiredMixin, generic.UpdateView):
form_class = StudyUpdateAttachmentsForm
group_required = settings.GROUP_SECRETARY

def form_valid(self, form):
ret = super().form_valid(form)
# Always regenerate the PDF after updating any study documents
# This is necessary, as the canonical PDF protection might already
# have kicked in if the secretary changes the documents later than
# we initially expected.
self.object.proposal.generate_pdf(force_overwrite=True)

return ret

def get_success_url(self):
"""Continue to the URL specified in the 'next' POST parameter"""
return self.request.POST.get('next', '/')
Expand Down

0 comments on commit 9c71bf6

Please sign in to comment.