I accidentally removed my Admin user from the Admin and Default groups. I need to grant Admin rights to the user again using the CLI because I can NOT do it in the UI. I’ve tried using this suggestion ./manage.py users grant_admin {email} and I am getting an error. Any help would be greatly appreciated.

Thanks,
Holden

1 Like

There are two options:

  1. Create a new admin user (using the manage.py CLI).
  2. Use psql to add the user to the groups again. This will be something like:
$ sudo sudo -u redash psql  # the double sudo is not a mistake, you will probably need it on a GCP instance.
> select id from groups; # note the resulting group ids -> probably 1 & 2.
> update users set groups = '{1,2}' where id = ...; # change 1,2 to the correct group IDs.

Worked perfectly. Thank you!

How can I create a new admin user using the manage.py CLI?