Fix updating lists with an identifier
Signed-off-by: kolaente <k@knt.li>
This commit is contained in:
parent
6132863f4a
commit
c6d22bb1f8
1 changed files with 4 additions and 1 deletions
|
@ -342,7 +342,10 @@ func CreateOrUpdateList(list *List) (err error) {
|
|||
|
||||
// Check if the identifier is unique and not empty
|
||||
if list.Identifier != "" {
|
||||
exists, err := x.Where("identifier = ?", list.Identifier).Exist(&List{})
|
||||
exists, err := x.
|
||||
Where("identifier = ?", list.Identifier).
|
||||
And("id != ?", list.ID).
|
||||
Exist(&List{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue