Ticket #14593: 14593.diff

File 14593.diff, 1.1 KB (added by idangazit, 4 years ago)

Deprecate gender checking in clean()

  • django/contrib/localflavor/cz/forms.py

    diff --git a/django/contrib/localflavor/cz/forms.py b/django/contrib/localflavor/cz/forms.py
    index 655e5ce..13a94af 100644
    a b class CZBirthNumberField(Field): 
    6262
    6363        birth, id = match.groupdict()['birth'], match.groupdict()['id']
    6464
    65         # Three digits for verificatin number were used until 1. january 1954
     65        # Three digits for verification number were used until 1. january 1954
    6666        if len(id) == 3:
    6767            return u'%s' % value
    6868
    6969        # Birth number is in format YYMMDD. Females have month value raised by 50.
    7070        # In case that all possible number are already used (for given date),
    71         #  the month field is raised by 20.
     71        # the month field is raised by 20.
    7272        if gender is not None:
     73            import warnings
     74            warnings.warn(
     75                "Support for validating the gender of a CZ Birth number has been deprecated.",
     76                DeprecationWarning)
    7377            if gender == 'f':
    7478                female_const = 50
    7579            elif gender == 'm':
Back to Top