@@ -68,7 +68,8 @@ def save(self, data: dict) -> ReportActivity:
6868
6969 # Only one ReportActivity record per report_version/facility/activity should ever exist
7070 report_activity , _ = ReportActivity .objects .update_or_create (
71- id = data .get ("id" ),
71+ # A None id is the intentional "create" path; django-stubs 6.0 rejects None in lookups.
72+ id = data .get ("id" ), # type: ignore[misc]
7273 report_version = self .report_version ,
7374 facility_report = self .facility_report ,
7475 activity = self .activity ,
@@ -121,7 +122,8 @@ def save_source_type(
121122 raise UserError (f"Source type { source_type_slug } is expecting emission data" )
122123
123124 report_source_type , _ = ReportSourceType .objects .update_or_create (
124- id = source_type_data .get ("id" ),
125+ # A None id is the intentional "create" path; django-stubs 6.0 rejects None in lookups.
126+ id = source_type_data .get ("id" ), # type: ignore[misc]
125127 report_version = self .facility_report .report_version ,
126128 report_activity = report_activity ,
127129 source_type = source_type ,
@@ -171,7 +173,7 @@ def save_unit(self, report_source_type: ReportSourceType, unit_data: dict) -> Re
171173
172174 # Update record if id was provided, create otherwise
173175 report_unit , _ = ReportUnit .objects .update_or_create (
174- id = report_unit_id ,
176+ id = report_unit_id , # type: ignore[misc]
175177 create_defaults = {
176178 "json_data" : json_data ,
177179 "report_source_type" : report_source_type ,
@@ -227,7 +229,7 @@ def save_fuel(
227229 fuel_type = FuelType .objects .get (name = fuel_name )
228230
229231 report_fuel , _ = ReportFuel .objects .update_or_create (
230- id = report_fuel_id ,
232+ id = report_fuel_id , # type: ignore[misc]
231233 create_defaults = {
232234 "json_data" : json_data ,
233235 "report_source_type" : report_source_type ,
@@ -272,7 +274,7 @@ def save_emission(
272274 raise UserError ("Emission is expecting methodology data" )
273275
274276 report_emission , _ = ReportEmission .objects .update_or_create (
275- id = report_emission_id ,
277+ id = report_emission_id , # type: ignore[misc]
276278 create_defaults = {
277279 "json_data" : json_data ,
278280 "report_source_type" : report_source_type ,
@@ -301,7 +303,7 @@ def save_methodology(
301303
302304 report_methodology_id = methodology_data .get ("id" )
303305 report_methodology , _ = ReportMethodology .objects .update_or_create (
304- id = report_methodology_id ,
306+ id = report_methodology_id , # type: ignore[misc]
305307 create_defaults = {
306308 "methodology" : methodology ,
307309 "json_data" : json_data ,
0 commit comments