Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
neophyte57 committed Aug 20, 2024
2 parents 07b5abb + ea7cf68 commit 7fb2008
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 61 deletions.
2 changes: 1 addition & 1 deletion document-manager/backend/.env-local
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DB_HOST=postgres
SQLALCHEMY_DATABASE_URI=postgres://postgres:postgres@postgres:5432/postgres
SQLALCHEMY_DATABASE_URI=postgresql://postgres:postgres@postgres:5432/postgres

# Used for building Location header redirects back to ourselves
DOCUMENT_MANAGER_URL=http://localhost:6001
Expand Down
2 changes: 1 addition & 1 deletion document-manager/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6
FROM python:3.12.4
SHELL ["/bin/bash","-c"]

# Update installation utility
Expand Down
2 changes: 1 addition & 1 deletion document-manager/backend/Dockerfile.migrate
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6
FROM python:3.12.4
SHELL ["/bin/bash","-c"]

# Update installation utility
Expand Down
4 changes: 2 additions & 2 deletions document-manager/backend/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from flask import Flask, current_app, request
from flask_cors import CORS
from flask_restplus import Resource
from flask_restplus.apidoc import apidoc
from flask_restx import Resource
from flask_restx.apidoc import apidoc
from flask_migrate import MigrateCommand

from flask_jwt_oidc.exceptions import AuthError
Expand Down
10 changes: 5 additions & 5 deletions document-manager/backend/app/docman/resources/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from werkzeug.exceptions import BadRequest, NotFound, Conflict, RequestEntityTooLarge, InternalServerError
from flask import request, current_app, send_file, make_response, jsonify
from flask_restplus import Resource, reqparse
from flask_restx import Resource, reqparse

from app.docman.models.document import Document
from app.extensions import api, cache, jwt
Expand Down Expand Up @@ -307,8 +307,8 @@ def get(self, document_guid):
if not doc:
raise NotFound()

return send_file(filename_or_fp=doc.full_storage_path,
attachment_filename=doc.filename,
return send_file(path_or_file=doc.full_storage_path,
download_name=doc.filename,
as_attachment=True)


Expand Down Expand Up @@ -348,6 +348,6 @@ def get(self, token):
if not doc:
raise NotFound('Could not find document')

return send_file(filename_or_fp=doc.full_storage_path,
attachment_filename=doc.filename,
return send_file(path_or_file=doc.full_storage_path,
download_name=doc.filename,
as_attachment=True)
2 changes: 1 addition & 1 deletion document-manager/backend/app/helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from flask import url_for
from flask_restplus import Api as BaseApi
from flask_restx import Api as BaseApi


class Api(BaseApi):
Expand Down
2 changes: 1 addition & 1 deletion document-manager/backend/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .healthcheck import *

from flask_jwt_oidc.exceptions import AuthError
from flask_restplus import Resource
from flask_restx import Resource
from healthcheck import HealthCheck


Expand Down
2 changes: 1 addition & 1 deletion document-manager/backend/app/utils/custom_reqparser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask_restplus import reqparse
from flask_restx import reqparse
from werkzeug.exceptions import BadRequest

DEFAULT_MISSING_REQUIRED = 'Missing required argument.'
Expand Down
2 changes: 1 addition & 1 deletion document-manager/backend/openshift.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM public.ecr.aws/bitnami/python:3.6-prod
FROM public.ecr.aws/bitnami/python:3.12.4

WORKDIR /opt/app-root/src

Expand Down
26 changes: 16 additions & 10 deletions document-manager/backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
blinker==1.8.2
cached_property==1.5.1
click==8.1.7
colorama==0.4.6
factory-boy==2.12.0
Flask==1.0.3
Flask==2.3.2
Flask-APScheduler==1.11.0
Flask-Caching==1.7.2
Flask-Caching==2.0.2
Flask-Cors==4.0.1
flask-compress==1.4.0
Flask-Migrate==2.5.2
flask-restplus==0.12.1
Flask-SQLAlchemy==2.4.0
flask-restx==1.1.0
Flask-SQLAlchemy==3.0.5
flask_jwt_oidc==0.1.5
itsdangerous==2.2.0
Jinja2==3.1.4
MarkupSafe==2.1.5
postgres==3.0.0
psycopg2==2.8.2
psycopg2-binary==2.8.2
psycopg2==2.9.6
psycopg2-binary==2.9.6
py-healthcheck==1.10.1
pytest==4.5.0
pytest-cov==2.7.1
python-dateutil==2.8.0
python-dotenv==0.10.2
python-magic==0.4.18
redis==3.2.1
requests==2.22.0
SQLAlchemy==1.3.4
uwsgi==2.0.18
requests==2.32.0
SQLAlchemy==2.0.19
uwsgi==2.0.23
uwsgitop==0.11
Werkzeug==0.15.4
Werkzeug==3.0.3
18 changes: 0 additions & 18 deletions document-manager/document-manager-base.dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions infrastructure/prime-app-ephemeral-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ objects:
name: keycloak
key: JWT_WELL_KNOWN_CONFIG
- name: SQLALCHEMY_DATABASE_URI
value: "postgres://$(PGUSER):$(PGPASSWORD)@$(PGHOST):5432/$(PGDATABASE)"
value: "postgresql://$(PGUSER):$(PGPASSWORD)@$(PGHOST):5432/$(PGDATABASE)"
envFrom:
- configMapRef:
name: document-manager
Expand Down Expand Up @@ -888,7 +888,7 @@ objects:
name: keycloak
key: JWT_WELL_KNOWN_CONFIG
- name: SQLALCHEMY_DATABASE_URI
value: "postgres://$(PGUSER):$(PGPASSWORD)@$(PGHOST):5432/$(PGDATABASE)"
value: "postgresql://$(PGUSER):$(PGPASSWORD)@$(PGHOST):5432/$(PGDATABASE)"
envFrom:
- configMapRef:
name: document-manager
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/prime-app-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ objects:
name: keycloak
key: JWT_WELL_KNOWN_CONFIG
- name: SQLALCHEMY_DATABASE_URI
value: "postgres://$(PGUSER):$(PGPASSWORD)@$(PGHOST):5432/$(PGDATABASE)"
value: "postgresql://$(PGUSER):$(PGPASSWORD)@$(PGHOST):5432/$(PGDATABASE)"
envFrom:
- configMapRef:
name: document-manager
Expand Down Expand Up @@ -968,7 +968,7 @@ objects:
name: keycloak
key: JWT_WELL_KNOWN_CONFIG
- name: SQLALCHEMY_DATABASE_URI
value: "postgres://$(PGUSER):$(PGPASSWORD)@$(PGHOST):5432/$(PGDATABASE)"
value: "postgresql://$(PGUSER):$(PGPASSWORD)@$(PGHOST):5432/$(PGDATABASE)"
envFrom:
- configMapRef:
name: document-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
<app-page-header>PharmaNet Site Registration</app-page-header>
<app-site-progress-indicator [inProgress]="!isCompleted"></app-site-progress-indicator>

<div class="mb-4">
<app-alert type="success"
icon="check_circle_outline">
<ng-container #alertTitle
class="alert-title">
You have accepted the Organization Agreement for PharmaNet Use.
</ng-container>
<ng-container #alertContent
class="alert-content">
Questions: Health Insurance BC toll free at 1-844-397-7463
</ng-container>
</app-alert>
</div>

<section class="mb-3">
<app-page-subheader2>
<ng-container appPageSubheader2Title>{{ title }}</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public async Task<Guid> SendFileAsync(Stream document, string filename, string d
folder = destinationFolder
});

_client.Timeout = TimeSpan.FromMinutes(5);

var response = await _client.PostAsync(url, new StreamContent(document));
var documentResponse = await response.Content.ReadAsAsync<DocumentGuidResponse>();

Expand Down
3 changes: 2 additions & 1 deletion prime-dotnet-webapi/Services/EnrolleeSubmissionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public async Task<Submission> CreateEnrolleeSubmissionAsync(int enrolleeId, bool
// set the self declaration version Id and add unanswered items
// *** answered Yes - it should have self declaration ID set
// *** answered No - it should NOT have self declaration ID
foreach (var sd in selfDeclarationQuestions)
// At a given point in time, a SD question may not exist for a particular SD type so the `selfDeclarationQuestions` list may contain null elements
foreach (var sd in selfDeclarationQuestions.Where(q => q != null))
{
if (enrollee.SelfDeclarations == null)
{
Expand Down

0 comments on commit 7fb2008

Please sign in to comment.