From 7f682b0e361b883ad8b220ede9b33e51314b6064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20H=C3=A1la?= Date: Fri, 14 Jun 2024 14:30:02 +0200 Subject: [PATCH] Remove constraint from PDFRequest to fix category delete --- pdf/models/request.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pdf/models/request.py b/pdf/models/request.py index 6d6e9ad..c2ed929 100644 --- a/pdf/models/request.py +++ b/pdf/models/request.py @@ -15,8 +15,6 @@ ForeignKey, CASCADE, SET_NULL, - CheckConstraint, - Q, PositiveIntegerField, ) from django.utils.translation import gettext_lazy as _ @@ -77,12 +75,6 @@ def get_songs(self) -> List[Song]: class Meta: verbose_name = _("PDFRequest") verbose_name_plural = _("PDFRequests") - constraints = [ - CheckConstraint( - check=Q(type=RequestType.MANUAL) | Q(category__isnull=False), - name="automated_category_present", - ), - ] ordering = ["-update_date"]