SQLStore: Fix wrong usage of xorm's insert functions in tests (#63850)

* SQLStore: Fix InsertId

* Prefs: Fix Insert return value

* Fix tests

* Add guidelines
This commit is contained in:
Sofia Papagiannaki
2023-03-02 13:01:36 +02:00
committed by GitHub
parent afd5f41780
commit 89569be3a6
7 changed files with 21 additions and 11 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ func (ss *SQLStore) getOrCreateOrg(sess *DBSession, orgName string) (int64, erro
org.Updated = time.Now()
if org.ID != 0 {
if _, err := sess.InsertId(&org, ss.Dialect); err != nil {
if err := sess.InsertId(&org, ss.Dialect); err != nil {
return 0, err
}
} else {