Merge pull request #323 from dod-ccpo/internal-comments

Hook up internal request comments
This commit is contained in:
patricksmithdds
2018-09-24 17:53:06 -04:00
committed by GitHub
8 changed files with 94 additions and 58 deletions

View File

@@ -45,7 +45,7 @@ class Request(Base, mixins.TimestampsMixin):
"RequestRevision", back_populates="request", order_by="RequestRevision.sequence"
)
internal_comments = relationship("RequestInternalComment", uselist=False)
internal_comments = relationship("RequestInternalComment")
@property
def latest_revision(self):
@@ -167,10 +167,6 @@ class Request(Base, mixins.TimestampsMixin):
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 ""
@property
def is_pending_financial_verification(self):
return self.status == RequestStatus.PENDING_FINANCIAL_VERIFICATION

View File

@@ -14,3 +14,4 @@ class RequestInternalComment(Base, mixins.TimestampsMixin):
user = relationship("User")
request_id = Column(ForeignKey("requests.id", ondelete="CASCADE"), nullable=False)
request = relationship("Request")