Skip to content

Commit

Permalink
Merge pull request #16 from shibaken/working
Browse files Browse the repository at this point in the history
working to compliance-mgt
  • Loading branch information
shibaken authored Mar 3, 2021
2 parents 61d290f + 08e6491 commit adc98a5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wildlifecompliance/components/sanction_outcome/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ def get_related_items_descriptor(self):
def regionDistrictId(self):
return self.district.id if self.district else self.region.id

@property
def regionDistrictName(self):
return self.district.name if self.district else self.region.name

@staticmethod
def get_compliance_permission_group(regionDistrictId, workflow_type):
region_district = RegionDistrict.objects.filter(id=regionDistrictId)
Expand Down
4 changes: 4 additions & 0 deletions wildlifecompliance/doctopdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def retrieve_context(sanction_outcome):
responsible_officer_name = sanction_outcome.responsible_officer.get_full_name() if sanction_outcome.responsible_officer else ''
issue_date = sanction_outcome.date_of_issue.strftime('%d/%m/%Y') if sanction_outcome.date_of_issue else ''
issue_time = sanction_outcome.time_of_issue.strftime('%I:%M %p') if sanction_outcome.time_of_issue else ''
remediation_actions = sanction_outcome.remediation_actions.all() if sanction_outcome.remediation_actions else ''
regionDistrict = sanction_outcome.regionDistrictName if sanction_outcome.regionDistrictName else ''
context = {
'lodgement_number': sanction_outcome.lodgement_number,
'offender_family_name': offender_family_name,
Expand All @@ -65,6 +67,8 @@ def retrieve_context(sanction_outcome):
'responsible_officer_name': responsible_officer_name,
'issue_date': issue_date,
'issue_time': issue_time,
'remediation_actions': remediation_actions,
'region_district': regionDistrict,
}
return context

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit adc98a5

Please sign in to comment.