From a342874ec081733052975b7134827bc6f6f4f59c Mon Sep 17 00:00:00 2001 From: Akira Date: Thu, 23 Jan 2025 17:08:50 +0900 Subject: [PATCH] Fix class name 9n --- rog/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rog/models.py b/rog/models.py index a3a7f1a..a96ae3d 100644 --- a/rog/models.py +++ b/rog/models.py @@ -402,6 +402,7 @@ class NewCategory(models.Model): num_of_member = models.IntegerField(default=1) family = models.BooleanField(default=False) female = models.BooleanField(default=False) + trial = models.BooleanField(default=False) class Meta: unique_together = ('category_name','category_number') @@ -463,8 +464,9 @@ class Entry(models.Model): else: if not adults: raise ValidationError("18歳以上のメンバーが1名以上必要です。") - if children: - raise ValidationError("ファミリーカテゴリー以外では、小学生以下のメンバーは参加できません。") + + if children and not self.category.trial: + raise ValidationError("ファミリーカテゴリーまたはお試し以外では、小学生以下のメンバーは参加できません。") if self.category.num_of_member == 1: if len(members) != 1: