def new_user(type, custom_options={}): service = Service.query.filter(Service.type == type).one() account = Account() account.fill(service) db.session.add(account) db.session.commit() return custom_action("new_user", service, custom_options, account=account)