Commit 35f9c2c0 authored by Claude Paroz's avatar Claude Paroz
Browse files

Cleaned up locale-related encoding issues

parent 3dd5d726
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals

# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
+1 −0
Original line number Diff line number Diff line
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals

# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
+3 −3
Original line number Diff line number Diff line
@@ -79,9 +79,9 @@ class CAProvinceField(Field):
            pass
        else:
            # Load data in memory only when it is required, see also #17275
            from django.contrib.localflavor.ca.ca_provinces import PROVINCES_NORMALIZED
            from .ca_provinces import PROVINCES_NORMALIZED
            try:
                return PROVINCES_NORMALIZED[value.strip().lower()].decode('ascii')
                return PROVINCES_NORMALIZED[value.strip().lower()]
            except KeyError:
                pass
        raise ValidationError(self.error_messages['invalid'])
@@ -93,7 +93,7 @@ class CAProvinceSelect(Select):
    """
    def __init__(self, attrs=None):
        # Load data in memory only when it is required, see also #17275
        from django.contrib.localflavor.ca.ca_provinces import PROVINCE_CHOICES
        from .ca_provinces import PROVINCE_CHOICES
        super(CAProvinceSelect, self).__init__(attrs, choices=PROVINCE_CHOICES)

class CASocialInsuranceNumberField(Field):
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
Spanish-specific Form helpers
"""

from __future__ import absolute_import
from __future__ import absolute_import, unicode_literals

import re

+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from __future__ import unicode_literals

PROVINCE_CHOICES = (
    ('01', ('Adana')),
Loading