Fix updating lists with an identifier

Signed-off-by: kolaente <k@knt.li>
This commit is contained in:
kolaente 2020-03-22 18:45:10 +01:00
parent 6132863f4a
commit c6d22bb1f8
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 1 deletions

View File

@ -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
}