def register(self, password): room = Room() room.password = password try: room.save() except: return None, False return room.id, True