Validation for 'Thema' on Vorgabe added
All checks were successful
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/vui) (push) Successful in 14s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/vui-data-loader) (push) Successful in 4s
SonarQube Scan / SonarQube Trigger (push) Successful in 54s

This commit is contained in:
2025-12-08 14:41:02 +01:00
parent 74d2f15d6a
commit 753c00bc45
5 changed files with 144 additions and 2 deletions

View File

@@ -169,6 +169,12 @@ class Vorgabe(models.Model):
"""
from django.core.exceptions import ValidationError
# Check that thema is provided
if not self.thema_id:
raise ValidationError({
'thema': 'Thema ist ein Pflichtfeld. Bitte wählen Sie ein Thema aus.'
})
# Check for conflicts with existing Vorgaben
conflicts = self.find_conflicts()
if conflicts: