Created
March 26, 2024 17:15
-
-
Save dryan/20e5932306f590762d2395a8b35b20e6 to your computer and use it in GitHub Desktop.
Django false-positive migration
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.contrib.gis.db import models | |
from django.utils.translation import gettext_lazy as _ | |
def validate_is_true(value): | |
if value is not True: | |
raise ValidationError(validate_is_true.error_message) | |
validate_is_true.error_message = _("This field is required") | |
class Pledge(models.Model): | |
consent = models.BooleanField( | |
_("I agree to abide by the Prideraiser Terms of Service and Code of Conduct."), | |
default=False, | |
validators=[validate_is_true], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment