83_Publication_rework #84

Merged
mpeltriaux merged 4 commits from 83_Publication_rework into master 2022-01-21 09:27:10 +01:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit ee6ac9e7c8 - Show all commits

View File

@ -290,6 +290,16 @@ class Compensation(AbstractCompensation, CEFMixin, CoherenceMixin):
"""
self.intervention.mark_as_edited(user, request, edit_comment)
def is_ready_for_publish(self) -> bool:
""" Not inherited by RecordableObjectMixin
Simplifies same usage for compensations as for other datatypes
Returns:
is_ready (bool): True|False
"""
return self.intervention.is_ready_for_publish()
class CompensationDocument(AbstractDocument):
"""

View File

@ -451,7 +451,7 @@ def report_view(request: HttpRequest, id: str):
tab_title = _("Report {}").format(comp.identifier)
# If intervention is not recorded (yet or currently) we need to render another template without any data
if not comp.intervention.is_ready_for_publish():
if not comp.is_ready_for_publish():
template = "report/unavailable.html"
context = {
TAB_TITLE_IDENTIFIER: tab_title,