Skip to content

Commit

Permalink
Merge pull request #545 from awf-dbca/db_update
Browse files Browse the repository at this point in the history
database update fix + validation fix
  • Loading branch information
preranaandure authored Feb 21, 2025
2 parents c87e144 + 486d7a7 commit 19b656a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"--hostname","mooringlicensing-dev"
],
"forwardPorts": [9121,9122,9123,9124,9125],
"initializeCommand" : "${localEnv:HOME}/docker-scripts-dev/windows_vbox/postgres_docker_load.sh && ${localEnv:HOME}/docker-scripts-dev/windows_vbox/ledger_docker_load.sh "
"initializeCommand" : "${localEnv:HOME}/docker-scripts-dev/windows_vbox/postgres_docker_load_2404.sh && ${localEnv:HOME}/docker-scripts-dev/windows_vbox/ledger_docker_load.sh "
}
5 changes: 2 additions & 3 deletions mooringlicensing/components/payments_ml/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,8 @@ def get_fee_constructor_by_application_type_and_date(cls, application_type=None,
try:
fee_constructor = None
fee_constructor_qs = cls.objects.filter(application_type=application_type,)\
.annotate(s_date=Min("fee_season__fee_periods__start_date"))\
.filter(s_date__lte=target_date, enabled=True).order_by('s_date')

.filter(fee_season__fee_periods__start_date__lte=target_date, enabled=True).order_by('fee_season__fee_periods__start_date')

# Validation
if not fee_constructor_qs:
raise Exception('No fees are configured for the application type: {} on the date: {}'.format(application_type, target_date))
Expand Down
6 changes: 3 additions & 3 deletions mooringlicensing/components/proposals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@ def validate_against_existing_proposals_and_approvals(self):
# Get blocking approvals
approvals = Approval.objects.filter(
(
Q(current_proposal__vessel_ownership__vessel=vessel) |
(Q(current_proposal__vessel_ownership__vessel=vessel) & ~Q(current_proposal__vessel_ownership__vessel=None)) |
Q(current_proposal__vessel_ownership__vessel__rego_no=self.rego_no)
) &
(
Expand Down Expand Up @@ -3224,7 +3224,7 @@ def validate_against_existing_proposals_and_approvals(self):
# Get blocking approvals
approvals = Approval.objects.filter(
(
Q(current_proposal__vessel_ownership__vessel=vessel) |
(Q(current_proposal__vessel_ownership__vessel=vessel) & ~Q(current_proposal__vessel_ownership__vessel=None)) |
Q(current_proposal__vessel_ownership__vessel__rego_no=self.rego_no)
) &
(
Expand Down Expand Up @@ -3750,7 +3750,7 @@ def validate_against_existing_proposals_and_approvals(self):
# Get blocking approvals
approvals = Approval.objects.filter(
(
Q(current_proposal__vessel_ownership__vessel=vessel) |
(Q(current_proposal__vessel_ownership__vessel=vessel) & ~Q(current_proposal__vessel_ownership__vessel=None)) |
Q(current_proposal__vessel_ownership__vessel__rego_no=self.rego_no)
) &
(
Expand Down

0 comments on commit 19b656a

Please sign in to comment.