fix: rename global scope as root and fix root md

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias
2019-01-07 20:34:44 +00:00
parent 01ff03e426
commit 33a58c999a
11 changed files with 26 additions and 29 deletions

View File

@@ -21,19 +21,17 @@ var usersUpdateCmd = &cobra.Command{
options you want to change.`,
Args: cobra.ExactArgs(1),
Run: python(func(cmd *cobra.Command, args []string, d pythonData) {
set, err := d.store.Settings.Get()
checkErr(err)
username, id := parseUsernameOrID(args[0])
password := mustGetString(cmd, "password")
newUsername := mustGetString(cmd, "username")
var err error
var user *users.User
if id != 0 {
user, err = d.store.Users.Get(set.Scope, id)
user, err = d.store.Users.Get("", id)
} else {
user, err = d.store.Users.Get(set.Scope, username)
user, err = d.store.Users.Get("", username)
}
checkErr(err)