def execute(): message = None bot = Builder.get_by_key_name(name) if bot: message = 'Updating the password since bot "%s" already exists' % name bot.update_password(password) else: Builder.create(name, password) return message
def execute(): message = None bot = Builder.get_by_key_name(name) if bot: message = 'Updating the password since bot "%s" already exists' % name bot.password = password else: bot = Builder(name=name, password=password, key_name=name) bot.put() return message