-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tracking pull request to merge release-1.21.0 to main (#590)
* update to 1.21.0 * update workflows (#591) * remove snowplowCollector for dev and test * update metabase knp * feat: itvr-593 - Application form error check DL# (#598) * feat: itvr-593 - Application form error check DL# * validation when updating a DL# --------- Co-authored-by: Kuan Fan <[email protected]>
- Loading branch information
1 parent
cf46138
commit 792741d
Showing
13 changed files
with
129 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from api.models.go_electric_rebate_application import GoElectricRebateApplication | ||
from django.db.models import Q | ||
|
||
|
||
def equivalent_drivers_licence_number_found( | ||
drivers_licence_number, application_id=None | ||
): | ||
equivalent_dl = drivers_licence_number | ||
if len(drivers_licence_number) == 7: | ||
equivalent_dl = "0" + drivers_licence_number | ||
elif len(drivers_licence_number) == 8 and drivers_licence_number.startswith("0"): | ||
equivalent_dl = drivers_licence_number[1:] | ||
exclude_lookup = {} | ||
if application_id is not None: | ||
exclude_lookup["id"] = application_id | ||
return ( | ||
GoElectricRebateApplication.objects.filter( | ||
Q(drivers_licence__exact=drivers_licence_number) | ||
| Q(drivers_licence__exact=equivalent_dl) | ||
) | ||
.filter( | ||
status__in=[ | ||
GoElectricRebateApplication.Status.SUBMITTED, | ||
GoElectricRebateApplication.Status.HOUSEHOLD_INITIATED, | ||
GoElectricRebateApplication.Status.VERIFIED, | ||
GoElectricRebateApplication.Status.APPROVED, | ||
GoElectricRebateApplication.Status.REDEEMED, | ||
] | ||
) | ||
.exclude(**exclude_lookup) | ||
.exists() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
openshift/templates/knp-for-helm-deployment/knp-env-metabase-dev.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: allow-spilo-accepts-metabase | ||
spec: | ||
## Allow spilo to accept communication from metabase | ||
podSelector: | ||
matchLabels: | ||
app.kubernetes.io/instance: itvr-spilo-dev | ||
app.kubernetes.io/name: spilo | ||
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 5432 | ||
from: | ||
- namespaceSelector: | ||
matchLabels: | ||
environment: dev | ||
name: 30b186 | ||
- podSelector: | ||
matchLabels: | ||
app: metabase | ||
policyTypes: | ||
- Ingress | ||
|
25 changes: 25 additions & 0 deletions
25
openshift/templates/knp-for-helm-deployment/knp-env-metabase-prod.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: allow-spilo-accepts-metabase | ||
spec: | ||
## Allow spilo to accept communication from metabase | ||
podSelector: | ||
matchLabels: | ||
app.kubernetes.io/instance: itvr-spilo | ||
app.kubernetes.io/name: spilo | ||
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 5432 | ||
from: | ||
- namespaceSelector: | ||
matchLabels: | ||
environment: prod | ||
name: 30b186 | ||
- podSelector: | ||
matchLabels: | ||
app: metabase | ||
policyTypes: | ||
- Ingress | ||
|
25 changes: 25 additions & 0 deletions
25
openshift/templates/knp-for-helm-deployment/knp-env-metabase-test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: allow-spilo-accepts-metabase | ||
spec: | ||
## Allow spilo to accept communication from metabase | ||
podSelector: | ||
matchLabels: | ||
app.kubernetes.io/instance: itvr-spilo | ||
app.kubernetes.io/name: spilo | ||
ingress: | ||
- ports: | ||
- protocol: TCP | ||
port: 5432 | ||
from: | ||
- namespaceSelector: | ||
matchLabels: | ||
environment: test | ||
name: 30b186 | ||
- podSelector: | ||
matchLabels: | ||
app: metabase | ||
policyTypes: | ||
- Ingress | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters