From e7c521fd1df0462f51cf4e7efa42ffd48eb517dc Mon Sep 17 00:00:00 2001 From: Sergey Glazyrin Date: Mon, 1 Nov 2021 22:47:37 +0100 Subject: [PATCH] minor fix --- core/gorm_persistence_storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/gorm_persistence_storage.go b/core/gorm_persistence_storage.go index a5c222e0..1a4ab213 100644 --- a/core/gorm_persistence_storage.go +++ b/core/gorm_persistence_storage.go @@ -800,7 +800,7 @@ func (afo *GormAdminFilterObjects) WithTransaction(handler func(afo1 IAdminFilte func (afo *GormAdminFilterObjects) LoadDataForModelByID(ID interface{}, model interface{}) { modelDescription := ProjectModels.GetModelFromInterface(model) - afo.UadminDatabase.Db.Preload(clause.Associations).Where(fmt.Sprintf(" \"%s\" = ?", modelDescription.Statement.Schema.PrimaryFields[0].Name), ID).First(model) + afo.UadminDatabase.Db.Preload(clause.Associations).Where(fmt.Sprintf(" \"%s\" = ?", modelDescription.Statement.Schema.PrimaryFields[0].DBName), ID).First(model) afo.SetLastError(afo.UadminDatabase.Db.Error) }