From db43cb97dc6bbea5801e1df9d93f101bb28140b8 Mon Sep 17 00:00:00 2001 From: richard-dds Date: Tue, 11 Sep 2018 15:39:15 -0400 Subject: [PATCH] Alias internal comments text --- atst/models/request.py | 4 ++++ atst/routes/requests/approval.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/atst/models/request.py b/atst/models/request.py index 2462c60f..0b90db6d 100644 --- a/atst/models/request.py +++ b/atst/models/request.py @@ -165,3 +165,7 @@ class Request(Base): @property def reviews(self): return [status.review for status in self.status_events if status.review] + + @property + def internal_comments_text(self): + return self.internal_comments.text if self.internal_comments else "" diff --git a/atst/routes/requests/approval.py b/atst/routes/requests/approval.py index 02185beb..fcb0ca66 100644 --- a/atst/routes/requests/approval.py +++ b/atst/routes/requests/approval.py @@ -32,7 +32,7 @@ def render_approval(request, form=None): if pending_final_approval and request.task_order: data["task_order"] = task_order_dictionary(request.task_order) - internal_comment_form = InternalCommentForm(text=request.internal_comments.text) + internal_comment_form = InternalCommentForm(text=request.internal_comments_text) return render_template( "requests/approval.html",