def delete_account(author: Union[AccountId, str], account: Union[AccountId, str], server: Server): """Delete account with authorization from account on server.""" author_acc = _get_account(author, server) _assert_authorized(author_acc, None) if not server.delete_account(author, account): raise ProcessCommandException()
def process_delete_account(author: AccountId, message: str, server: Server, **kwargs): assert_authorized(author, server, Authorization.ADMIN) parsed = parse_delete_account(message) if parsed is None: raise CommandException('Incorrect formatting; **SMH**') account = parsed return "Success" if server.delete_account( author, account) else 'dunno Something broke'