- Bug fixes:

- Catalog Name Unique Constraint
  - Selection constraint to view processed document
  - remove tab from tenant overview
This commit is contained in:
Josako
2025-06-07 11:14:23 +02:00
parent bc1626c4ff
commit 8f45005713
6 changed files with 61 additions and 162 deletions

View File

@@ -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)