Ticket #10204: spanish_nie.patch

File spanish_nie.patch, 831 bytes (added by meaksh, 6 years ago)
  • django/contrib/localflavor/es/forms.py

     
    7575        self.nif_control = 'TRWAGMYFPDXBNJZSQVHLCKE'
    7676        self.cif_control = 'JABCDEFGHI'
    7777        self.cif_types = 'ABCDEFGHKLMNPQS'
    78         self.nie_types = 'XT'
     78        self.nie_types = 'XTYZ'
    7979        id_card_re = re.compile(r'^([%s]?)[ -]?(\d+)[ -]?([%s]?)$' % (self.cif_types + self.nie_types, self.nif_control + self.cif_control), re.IGNORECASE)
    8080        super(ESIdentityCardNumberField, self).__init__(id_card_re, max_length=None, min_length=None,
    8181                error_message=self.default_error_messages['invalid%s' % (self.only_nif and '_only_nif' or '')],
Back to Top