Skip to content

Commit e035a9d

Browse files
authored
Merge pull request #1898 from bcgov/fix/daniel-fixes-1871
fix: 2 Bug Fixes
2 parents 6140dc1 + 016a1c2 commit e035a9d

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

backend/lcfs/web/api/compliance_report/repo.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,7 @@ def apply_sub_filters(self, pagination, conditions):
105105
elif filter.field == "organization":
106106
continue
107107
elif filter.field == "type":
108-
field = get_field_for_filter(ComplianceReport, "reporting_frequency")
109-
filter_value = (
110-
ReportingFrequency.ANNUAL.value
111-
if filter_value.lower().startswith("c")
112-
else ReportingFrequency.QUARTERLY.value
113-
)
108+
field = get_field_for_filter(ComplianceReport, "nickname")
114109
elif filter.field == "compliance_period":
115110
continue
116111
else:

backend/lcfs/web/api/compliance_report/services.py

-4
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ async def create_supplemental_report(
9999
The report_id can be any report in the series (original or supplemental).
100100
Supplemental reports are only allowed if the status of the current report is 'Assessed'.
101101
"""
102-
# check if we're passing a specifc user otherwise use request user
103-
if not user:
104-
user = self.request.user
105-
106102
# Fetch the current report using the provided report_id
107103
current_report = await self.repo.get_compliance_report_by_id(
108104
report_id, is_model=True

backend/lcfs/web/api/compliance_report/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,4 @@ async def create_supplemental_report(
173173
"""
174174
Create a supplemental compliance report.
175175
"""
176-
return await service.create_supplemental_report(report_id)
176+
return await service.create_supplemental_report(report_id, request.user)

frontend/src/views/ComplianceReports/components/_schema.jsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ export const reportsColDefs = (t, bceidRole) => [
2727
field: 'type',
2828
headerName: t('report:reportColLabels.type'),
2929
flex: 2,
30-
valueGetter: ({ data }) => {
31-
const typeLabel = t('report:complianceReport')
32-
const nickname = data.nickname ? ` - ${data.nickname}` : ''
33-
return `${typeLabel}${nickname}`
34-
},
30+
valueGetter: ({ data }) => data.nickname,
3531
filter: 'agTextColumnFilter', // Enable text filtering
3632
filterParams: {
3733
textFormatter: (value) => value.replace(/\s+/g, '').toLowerCase(),

0 commit comments

Comments
 (0)