-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 34 prefix value (ar localflavor ARCUITField). #342
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
|
||
|
||
class ARProvinceSelect(Select): | ||
"""A Select widget that uses a list of Argentinean provinces/autonomous cities as its choices.""" | ||
"""A Select widget that uses a list of Argentinean provinces/autonomous | ||
cities as its choices.""" | ||
|
||
def __init__(self, attrs=None): | ||
super(ARProvinceSelect, self).__init__(attrs, choices=PROVINCE_CHOICES) | ||
|
@@ -22,8 +23,9 @@ class ARPostalCodeField(RegexField): | |
A field that accepts a 'classic' NNNN Postal Code or a CPA. | ||
|
||
See: | ||
http://www.correoargentino.com.ar/cpa/que_es | ||
http://www.correoargentino.com.ar/cpa/como_escribirlo | ||
|
||
* http://www.correoargentino.com.ar/cpa/que_es | ||
* http://www.correoargentino.com.ar/cpa/como_escribirlo | ||
""" | ||
|
||
default_error_messages = { | ||
|
@@ -77,19 +79,19 @@ class ARCUITField(RegexField): | |
""" | ||
This field validates a CUIT (Código Único de Identificación Tributaria). | ||
|
||
ACUIT is of the form XX-XXXXXXXX-V. The last digit is a check digit. | ||
A CUIT is of the form XX-XXXXXXXX-V. The last digit is a check digit. | ||
|
||
More info: | ||
http://es.wikipedia.org/wiki/Clave_%C3%9Anica_de_Identificaci%C3%B3n_Tributaria | ||
|
||
English info: | ||
Info in English: | ||
http://www.justlanded.com/english/Argentina/Argentina-Guide/Visas-Permits/Other-Legal-Documents | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be great if you could add |
||
|
||
default_error_messages = { | ||
'invalid': _('Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format.'), | ||
'checksum': _("Invalid CUIT."), | ||
'legal_type': _('Invalid legal type. Type must be 27, 20, 30, 23, 24 or 33.'), | ||
'legal_type': _('Invalid legal type. Type must be 27, 20, 30, 23, 24, 33 or 34.'), | ||
} | ||
|
||
def __init__(self, *args, **kwargs): | ||
|
@@ -101,7 +103,7 @@ def clean(self, value): | |
if value in self.empty_values: | ||
return self.empty_value | ||
value, cd = self._canon(value) | ||
if not value[:2] in ['27', '20', '30', '23', '24', '33']: | ||
if not value[:2] in ['27', '20', '30', '23', '24', '33', '34']: | ||
raise ValidationError(self.error_messages['legal_type']) | ||
if self._calc_cd(value) != cd: | ||
raise ValidationError(self.error_messages['checksum']) | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we generally go to next line after
"""
when it takes more than one line, but that's nit-picking...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. We're using 120 character lines so you can also just not include this change. Either way is fine.