1
0

fix(label): ignore existing ID during creation

(cherry picked from commit e698ac5a346785df623553104c5650566d1a9bcd)
This commit is contained in:
kolaente 2024-09-10 16:45:40 +02:00
parent 1b55be6a15
commit c5f043c346
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B

View File

@ -51,7 +51,7 @@ type Label struct {
}
// TableName makes a pretty table name
func (Label) TableName() string {
func (*Label) TableName() string {
return "labels"
}
@ -73,6 +73,7 @@ func (l *Label) Create(s *xorm.Session, a web.Auth) (err error) {
return
}
l.ID = 0
l.HexColor = utils.NormalizeHex(l.HexColor)
l.CreatedBy = u
l.CreatedByID = u.ID