- Bug fixes:
- Catalog Name Unique Constraint - Selection constraint to view processed document - remove tab from tenant overview
This commit is contained in:
@@ -17,8 +17,15 @@ from config.type_defs.processor_types import PROCESSOR_TYPES
|
||||
from .dynamic_form_base import DynamicFormBase
|
||||
|
||||
|
||||
def validate_catalog_name(form, field):
|
||||
# Controleer of een catalog met deze naam al bestaat
|
||||
existing_catalog = Catalog.query.filter_by(name=field.data).first()
|
||||
if existing_catalog:
|
||||
raise ValidationError(f'A Catalog with name "{field.data}" already exists. Choose another name.')
|
||||
|
||||
|
||||
class CatalogForm(FlaskForm):
|
||||
name = StringField('Name', validators=[DataRequired(), Length(max=50)])
|
||||
name = StringField('Name', validators=[DataRequired(), Length(max=50), validate_catalog_name])
|
||||
description = TextAreaField('Description', validators=[Optional()])
|
||||
|
||||
# Select Field for Catalog Type (Uses the CATALOG_TYPES defined in config)
|
||||
@@ -41,7 +48,7 @@ class CatalogForm(FlaskForm):
|
||||
|
||||
|
||||
class EditCatalogForm(DynamicFormBase):
|
||||
name = StringField('Name', validators=[DataRequired(), Length(max=50)])
|
||||
name = StringField('Name', validators=[DataRequired(), Length(max=50), validate_catalog_name])
|
||||
description = TextAreaField('Description', validators=[Optional()])
|
||||
|
||||
# Select Field for Catalog Type (Uses the CATALOG_TYPES defined in config)
|
||||
|
||||
Reference in New Issue
Block a user