Skip to content

Commit

Permalink
filtering out now_submission docs with deleted_ind equal true
Browse files Browse the repository at this point in the history
  • Loading branch information
asinn134 committed Oct 11, 2023
1 parent 3d5083c commit 417d3c7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class NOWApplicationResource(Resource, UserMixin):
@api.marshal_with(NOW_APPLICATION_MODEL, code=200)
def get(self, application_guid):
original = request.args.get('original', False, type=bool)

submission_docs = []
now_application_identity = NOWApplicationIdentity.find_by_guid(application_guid)
if not now_application_identity:
raise NotFound('No identity record for this application guid.')
Expand All @@ -49,6 +49,11 @@ def get(self, application_guid):
application = transmogrify_now(now_application_identity, include_contacts=original)
application.imported_to_core = False

for doc in application.submission_documents:
if doc.deleted_ind == False:
submission_docs.append(doc)

application.submission_documents = submission_docs
application.is_historic = ApplicationsView.query.filter_by(
now_application_guid=application.now_application_guid).one().is_historic
application.filtered_submission_documents = NOWApplication.get_filtered_submissions_documents(
Expand Down

0 comments on commit 417d3c7

Please sign in to comment.