Skip to content

Commit

Permalink
Merge pull request #517 from awf-dbca/misc-fixes-6
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
xzzy authored Jan 15, 2025
2 parents fb13d01 + 6d9c63d commit 9dfa331
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
6 changes: 3 additions & 3 deletions mooringlicensing/components/approvals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ class DcvAdmission(RevisionedMixin):
date_created = models.DateTimeField(blank=True, null=True, auto_now_add=True)
status = models.CharField(max_length=40, choices=STATUS_CHOICES, null=True, blank=True)

invoice_property_cache = JSONField(null=True, blank=True, default={})
invoice_property_cache = JSONField(null=True, blank=True, default=dict)

@property
def admin_group(self):
Expand Down Expand Up @@ -2851,7 +2851,7 @@ class DcvPermit(RevisionedMixin):
postal_address_state = models.CharField(max_length=255, default='WA', blank=True, null=True)
postal_address_country = CountryField(default='AU', blank=True, null=True)

invoice_property_cache = JSONField(null=True, blank=True, default={})
invoice_property_cache = JSONField(null=True, blank=True, default=dict)

@property
def submitter_obj(self):
Expand Down Expand Up @@ -3174,7 +3174,7 @@ class Sticker(models.Model):
postal_address_country = CountryField(default='AU', null=True, blank=True)
postal_address_postcode = models.CharField(max_length=10, null=True, blank=True)

invoice_property_cache = JSONField(null=True, blank=True, default={})
invoice_property_cache = JSONField(null=True, blank=True, default=dict)

class Meta:
app_label = 'mooringlicensing'
Expand Down
4 changes: 2 additions & 2 deletions mooringlicensing/components/proposals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class Proposal(DirtyFieldsMixin, RevisionedMixin):

proposed_issuance_approval = JSONField(blank=True, null=True)

invoice_property_cache = JSONField(null=True, blank=True, default={})
invoice_property_cache = JSONField(null=True, blank=True, default=dict)

customer_status = models.CharField('Customer Status',
max_length=40, choices=CUSTOMER_STATUS_CHOICES,
Expand Down Expand Up @@ -3820,7 +3820,7 @@ def create_fee_lines(self):
'vessel_details_id': vessel_details_largest.id if vessel_details_largest else '',
'fee_amount_adjusted': str(fee_amount_adjusted),
})
line_items.append(generate_line_item(self.application_type, fee_amount_adjusted, fee_constructor_for_ml, self, current_datetime))
line_items.append(generate_line_item(self.application_type, fee_amount_adjusted, fee_constructor_for_ml, self, current_datetime, vessel_details_largest.vessel.rego_no))

# For Annual Admission component
for vessel_details in vessel_detais_list_to_be_processed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export default {
return this.proposal.processing_status == 'Declined' || this.proposal.processing_status == 'Approved';
},
canAssess: function(){
return this.hasAssessorMode || this.hasApproverMode;
return this.proposal.assessor_mode.assessor_can_assess;
},
hasAssessorMode:function(){
return this.proposal && this.proposal.assessor_mode.has_assessor_mode ? true : false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.0.9 on 2025-01-15 00:47

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mooringlicensing', '0386_applicationfee_payment_status_and_more'),
]

operations = [
migrations.AlterField(
model_name='dcvadmission',
name='invoice_property_cache',
field=models.JSONField(blank=True, default=dict, null=True),
),
migrations.AlterField(
model_name='dcvpermit',
name='invoice_property_cache',
field=models.JSONField(blank=True, default=dict, null=True),
),
migrations.AlterField(
model_name='proposal',
name='invoice_property_cache',
field=models.JSONField(blank=True, default=dict, null=True),
),
migrations.AlterField(
model_name='sticker',
name='invoice_property_cache',
field=models.JSONField(blank=True, default=dict, null=True),
),
]
5 changes: 4 additions & 1 deletion mooringlicensing/utils/mooring_licence_migrate_pd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,10 @@ def create_annual_admissions(self):
)

except Exception as e:
errors.append("Rego No " + str(rego_no) + " - User Id " + str(user.id) + ":" + str(e))
if user:
errors.append("Rego No " + str(rego_no) + " - User Id " + str(user.id) + ":" + str(e))
else:
errors.append("Rego No " + str(rego_no) + " - User Id None:" + str(e))

print(f'rego_aa_created: {len(rego_aa_created)}')
print(f'total_aa_created: {len(total_aa_created)}')
Expand Down

0 comments on commit 9dfa331

Please sign in to comment.