From c6d22bb1f8926947ba46da576dbfb45477ab1002 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 22 Mar 2020 18:45:10 +0100 Subject: [PATCH] Fix updating lists with an identifier Signed-off-by: kolaente --- pkg/models/list.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/models/list.go b/pkg/models/list.go index 3ff82c3feee..3764f95723c 100644 --- a/pkg/models/list.go +++ b/pkg/models/list.go @@ -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 }