fix(label): ignore existing ID during creation
(cherry picked from commit e698ac5a346785df623553104c5650566d1a9bcd)
This commit is contained in:
parent
1b55be6a15
commit
c5f043c346
@ -51,7 +51,7 @@ type Label struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TableName makes a pretty table name
|
// TableName makes a pretty table name
|
||||||
func (Label) TableName() string {
|
func (*Label) TableName() string {
|
||||||
return "labels"
|
return "labels"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,6 +73,7 @@ func (l *Label) Create(s *xorm.Session, a web.Auth) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l.ID = 0
|
||||||
l.HexColor = utils.NormalizeHex(l.HexColor)
|
l.HexColor = utils.NormalizeHex(l.HexColor)
|
||||||
l.CreatedBy = u
|
l.CreatedBy = u
|
||||||
l.CreatedByID = u.ID
|
l.CreatedByID = u.ID
|
||||||
|
Loading…
x
Reference in New Issue
Block a user