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
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

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
}