-1
私はpre_saveでvalidationErrorを発生させていますが、新しいオブジェクトを作成しようとすると、赤色のエラーが表示されず、エラーの黄色のページが表示されます。管理者にカスタムエラーを表示する方法
@receiver(pre_save, sender=Student)
def student_pre_save(sender,instance, **kwargs):
if instance.classroom.student_set.count() == instance.classroom.QttMax_Stu:
raise ValidationError("No places left")