File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -195,8 +195,8 @@ def assemble_preprod_artifact_size_analysis(
195
195
id = artifact_id ,
196
196
)
197
197
198
- # Get or create PreprodArtifactSizeMetrics record
199
- size_metrics , created = PreprodArtifactSizeMetrics .objects .get_or_create (
198
+ # Upsert PreprodArtifactSizeMetrics record
199
+ size_metrics , created = PreprodArtifactSizeMetrics .objects .update_or_create (
200
200
preprod_artifact = preprod_artifact ,
201
201
defaults = {
202
202
"analysis_file_id" : assemble_result .bundle .id ,
@@ -205,12 +205,6 @@ def assemble_preprod_artifact_size_analysis(
205
205
},
206
206
)
207
207
208
- if not created :
209
- # Update existing record
210
- size_metrics .analysis_file_id = assemble_result .bundle .id
211
- size_metrics .state = PreprodArtifactSizeMetrics .SizeAnalysisState .COMPLETED
212
- size_metrics .save (update_fields = ["analysis_file_id" , "state" , "date_updated" ])
213
-
214
208
logger .info (
215
209
"Created or updated preprod artifact size metrics with analysis file" ,
216
210
extra = {
You can’t perform that action at this time.
0 commit comments