def validate_name(self, field): if field.data: room = VCRoom.find_first( VCRoom.name == field.data, VCRoom.status != VCRoomStatus.deleted, VCRoom.type == self.service_name ) if room and room != self.vc_room: raise ValidationError(_("There is already a room with this name"))
def validate_name(self, field): if field.data: room = VCRoom.find_first(VCRoom.name == field.data, VCRoom.status != VCRoomStatus.deleted, VCRoom.type == self.service_name) if room and room != self.vc_room: raise ValidationError( _("There is already a room with this name"))
def process_formdata(self, valuelist): if valuelist and valuelist[0].isdigit(): self.data = VCRoom.get(valuelist[0])