def botname_validator(self, value): """ Check if botname is unique """ if Bot.exists(value): raise ValueError('botname should be unique') else: return value
def delete_bot_validator(self, value): if Bot.exists(value): return value else: abort(400, botname='botname does\'t exist')
def botname_validator(self, value): if Bot.exists(value): return value else: raise ValueError('botname does\'t exist')