From 9cd8631468db4a824df51dec15f12b54f4f2af96 Mon Sep 17 00:00:00 2001 From: chavacava Date: Fri, 1 Nov 2024 12:25:12 -0300 Subject: [PATCH] removes unnecessary conditional (#1777) --- backend/models/storage.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/models/storage.go b/backend/models/storage.go index 0d9f0315a..572953216 100644 --- a/backend/models/storage.go +++ b/backend/models/storage.go @@ -783,11 +783,7 @@ func (db *Database) GetDiggerJobFromRunStage(stage DiggerRunStage) (*DiggerJob, job := &DiggerJob{} result := db.GormDB.Preload("Batch").Take(job, "batch_id = ?", stage.BatchID) if result.Error != nil { - if errors.Is(result.Error, gorm.ErrRecordNotFound) { - return nil, result.Error - } else { - return nil, result.Error - } + return nil, result.Error } return job, nil }