From 84ba8debadac9447421869add2124974ae63422b Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sat, 26 Jan 2019 09:33:48 +0000 Subject: [PATCH] fix: import users with non existing id License: MIT Signed-off-by: Henrique Dias --- cmd/users_import.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/users_import.go b/cmd/users_import.go index f1c873af..ea84beab 100644 --- a/cmd/users_import.go +++ b/cmd/users_import.go @@ -70,6 +70,10 @@ list or set it to 0.`, checkErr(usernameConflictError(user.Username, conflictuous.ID, user.ID)) } } + } else { + // If it doesn't exist, set the ID to 0 to automatically get a new + // one that make sense in this DB. + user.ID = 0 } err = d.store.Users.Save(user)