summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/db/content.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/system/db/content.go b/system/db/content.go
index 52fc8d5..0661556 100644
--- a/system/db/content.go
+++ b/system/db/content.go
@@ -494,6 +494,7 @@ func checkSlugForDuplicate(slug string) (string, error) {
// check for existing slug in __contentIndex
err := store.View(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte("__contentIndex"))
+ original := slug
exists := true
i := 0
for exists {
@@ -504,7 +505,7 @@ func checkSlugForDuplicate(slug string) (string, error) {
}
i++
- slug = fmt.Sprintf("%s-%d", slug, i)
+ slug = fmt.Sprintf("%s-%d", original, i)
}
return nil