Hi Folks. When I try to deactivate a user, I get an error message: “Leaving the app without an active admin is not allowed [error-action-not-allowed]”, but I have the admin role. It was OK on the last version 3. But now, after upgrading to 4.1.0, this happens. Is this a bug or something needs to be adjusted somewhere?
Made a clean installation. The versions are the same as in the working installation. The settings are all by default. Created a user and when I try to deactivate it, the same error. Also another error came up, when trying to change the password of the user in the admin panel, there is an error: “TOTP Required [totp-required]”.
I was able to reproduce this error. It’s indeed a bug.
You can no longer deactivate any user because of this new check. The user I tried to deactivate is not even an admin.
This will happen if you only have one admin. If you create a second admin, it will work.
it probably needs to check if the user marked for deactivation is an admin.
I can confirm the same happens when trying to deactivate thru the REST API:
In [9]: t = rocket.users_set_active_status(user_id="L9GwYzGLotxnfgTp8", active_status=False)
In [10]: t
Out[10]: <Response [400]>
In [11]: t.json()
Out[11]:
{'success': False,
'error': 'Leaving the app without an active admin is not allowed [error-action-not-allowed]',
'errorType': 'error-action-not-allowed',
'details': {'method': 'removeUserFromRole', 'action': 'Remove_last_admin'}}