Fixed #14593 -- Deprecating CZBirthNumberField's second argument to clean()
Gender is not necessary to determine whether a birth number is valid, it just validates some further restrictions and shouldn't be part of the field's validation. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15048 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5a55922baa
commit
9ad2ef338d
|
@ -62,14 +62,18 @@ class CZBirthNumberField(Field):
|
||||||
|
|
||||||
birth, id = match.groupdict()['birth'], match.groupdict()['id']
|
birth, id = match.groupdict()['birth'], match.groupdict()['id']
|
||||||
|
|
||||||
# Three digits for verificatin number were used until 1. january 1954
|
# Three digits for verification number were used until 1. january 1954
|
||||||
if len(id) == 3:
|
if len(id) == 3:
|
||||||
return u'%s' % value
|
return u'%s' % value
|
||||||
|
|
||||||
# Birth number is in format YYMMDD. Females have month value raised by 50.
|
# Birth number is in format YYMMDD. Females have month value raised by 50.
|
||||||
# In case that all possible number are already used (for given date),
|
# In case that all possible number are already used (for given date),
|
||||||
# the month field is raised by 20.
|
# the month field is raised by 20.
|
||||||
if gender is not None:
|
if gender is not None:
|
||||||
|
import warnings
|
||||||
|
warnings.warn(
|
||||||
|
"Support for validating the gender of a CZ Birth number has been deprecated.",
|
||||||
|
DeprecationWarning)
|
||||||
if gender == 'f':
|
if gender == 'f':
|
||||||
female_const = 50
|
female_const = 50
|
||||||
elif gender == 'm':
|
elif gender == 'm':
|
||||||
|
|
Loading…
Reference in New Issue