Warn if trying to remove the admin account

main
Bob Mottram 2023-05-23 18:25:46 +01:00
parent b31b2c1338
commit 2087125cd5
1 changed files with 5 additions and 0 deletions

View File

@ -2882,6 +2882,11 @@ def _command_options() -> None:
argb.rmaccount = argb.deactivate
if argb.rmaccount:
admin_nickname = get_config_param(base_dir, 'admin')
if admin_nickname:
if admin_nickname == argb.rmaccount:
print(argb.rmaccount + ' is the admin account')
sys.exit()
if '@' in argb.rmaccount:
nickname = argb.rmaccount.split('@')[0]
domain = argb.rmaccount.split('@')[1]