Last active
November 9, 2021 10:17
-
-
Save UnknownPlatypus/882cb78b0e03a0d26292e842733fd27b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.db import models | |
from django.utils.translation import gettext_lazy as _ | |
class RenovationConfirmationContent(models.Model): | |
faq_title = models.CharField(max_length=191) | |
faqCategory = models.ForeignKey("content.faq") | |
def clean(self): | |
if self.faqCategory and not self.faq_title: | |
raise forms.ValidationError({ | |
"faq_title": "Si une faq est affichée, il est obligatoire de lui donner un titre" | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment