Skip to content

Commit 663f9aa

Browse files
authored
Correct US_STATES to sort by state name, as it originally did. #424 (#428)
1 parent ffb09b3 commit 663f9aa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/changelog.rst

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Modifications to existing flavors:
2121
Previous State Jammu and Kashmir (JK) is now under Union Territories, Ladakh (LA) is the new addition in the Union Territories.
2222
Few modificication in the States and Union Territories names: Orissa (OR) is now Odisha (OR), Pondicherry (PY) is now Puducherry (PY)
2323
Andaman and Nicobar (AN) is now Andaman and Nicobar Islands (AN).
24+
- Correct sorting of US_STATES to sort by full name rather than code
25+
(`gh-424 <https://github.com/django/django-localflavor/issues/424>`_
26+
`gh-428 <https://github.com/django/django-localflavor/pull/428>`_).
2427

2528
Other changes:
2629

localflavor/us/us_states.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112

113113
US_STATES = lazy(lambda: tuple(sorted(
114114
CONTIGUOUS_STATES + NON_CONTIGUOUS_STATES,
115-
key=operator.itemgetter(0))), tuple)()
115+
key=operator.itemgetter(1))), tuple)()
116116
"""
117117
This docstring is not read by Sphinx, so it has been copied to
118118
docs/localflavor/us.rst.

0 commit comments

Comments
 (0)