Commit cae5623f by muzaffaryousaf

Updating the django-countries version to support sorting.

Adding the pyuca to support sorting in differnet languages.

TNL-2047
parent 378cf9bb
...@@ -47,7 +47,7 @@ class LearnerProfileTestMixin(EventsTestMixin): ...@@ -47,7 +47,7 @@ class LearnerProfileTestMixin(EventsTestMixin):
Fill in the public profile fields of a user. Fill in the public profile fields of a user.
""" """
profile_page.value_for_dropdown_field('language_proficiencies', 'English') profile_page.value_for_dropdown_field('language_proficiencies', 'English')
profile_page.value_for_dropdown_field('country', 'United Kingdom') profile_page.value_for_dropdown_field('country', 'United Arab Emirates')
profile_page.value_for_textarea_field('bio', 'Nothing Special') profile_page.value_for_textarea_field('bio', 'Nothing Special')
def visit_profile_page(self, username, privacy=None): def visit_profile_page(self, username, privacy=None):
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import logging import logging
import json import json
from ipware.ip import get_ip from ipware.ip import get_ip
import pyuca
from django.conf import settings from django.conf import settings
from django.contrib import messages from django.contrib import messages
...@@ -339,16 +338,6 @@ def account_settings_context(request): ...@@ -339,16 +338,6 @@ def account_settings_context(request):
""" """
user = request.user user = request.user
collator = pyuca.Collator()
sort_key = lambda item: collator.sort_key(unicode(item[1]))
country_options = [
(country_code, _(country_name)) # pylint: disable=translation-of-non-string
for country_code, country_name in sorted(
countries.countries, key=sort_key
)
]
year_of_birth_options = [(unicode(year), unicode(year)) for year in UserProfile.VALID_YEARS] year_of_birth_options = [(unicode(year), unicode(year)) for year in UserProfile.VALID_YEARS]
context = { context = {
...@@ -356,7 +345,7 @@ def account_settings_context(request): ...@@ -356,7 +345,7 @@ def account_settings_context(request):
'duplicate_provider': None, 'duplicate_provider': None,
'fields': { 'fields': {
'country': { 'country': {
'options': country_options, 'options': list(countries),
}, 'gender': { }, 'gender': {
'options': [(choice[0], _(choice[1])) for choice in UserProfile.GENDER_CHOICES], # pylint: disable=translation-of-non-string 'options': [(choice[0], _(choice[1])) for choice in UserProfile.GENDER_CHOICES], # pylint: disable=translation-of-non-string
}, 'language': { }, 'language': {
......
""" Views for a student's profile information. """ """ Views for a student's profile information. """
import pyuca
from django.conf import settings from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django_countries import countries from django_countries import countries
...@@ -67,15 +65,6 @@ def learner_profile_context(logged_in_user, profile_username, user_is_staff, bui ...@@ -67,15 +65,6 @@ def learner_profile_context(logged_in_user, profile_username, user_is_staff, bui
""" """
profile_user = User.objects.get(username=profile_username) profile_user = User.objects.get(username=profile_username)
collator = pyuca.Collator()
sort_key = lambda item: collator.sort_key(unicode(item[1]))
country_options = [
(country_code, _(country_name)) # pylint: disable=translation-of-non-string
for country_code, country_name in sorted(
countries.countries, key=sort_key
)
]
own_profile = (logged_in_user.username == profile_username) own_profile = (logged_in_user.username == profile_username)
account_settings_data = get_account_settings(logged_in_user, profile_username) account_settings_data = get_account_settings(logged_in_user, profile_username)
...@@ -102,7 +91,7 @@ def learner_profile_context(logged_in_user, profile_username, user_is_staff, bui ...@@ -102,7 +91,7 @@ def learner_profile_context(logged_in_user, profile_username, user_is_staff, bui
'account_settings_page_url': reverse('account_settings'), 'account_settings_page_url': reverse('account_settings'),
'has_preferences_access': (logged_in_user.username == profile_username or user_is_staff), 'has_preferences_access': (logged_in_user.username == profile_username or user_is_staff),
'own_profile': own_profile, 'own_profile': own_profile,
'country_options': country_options, 'country_options': list(countries),
'language_options': settings.ALL_LANGUAGES, 'language_options': settings.ALL_LANGUAGES,
'platform_name': microsite.get_value('platform_name', settings.PLATFORM_NAME), 'platform_name': microsite.get_value('platform_name', settings.PLATFORM_NAME),
} }
......
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
<label for="country">${_("Country")}</label> <label for="country">${_("Country")}</label>
<select id="country" name="country" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['country'] == 'required' else ''}> <select id="country" name="country" ${'required aria-required="true"' if settings.REGISTRATION_EXTRA_FIELDS['country'] == 'required' else ''}>
<option value="">--</option> <option value="">--</option>
%for code, country_name in sorted(countries.countries, key=lambda (__, name): unicode(name)): %for code, country_name in countries:
<option value="${code}">${ unicode(country_name) }</option> <option value="${code}">${ unicode(country_name) }</option>
%endfor %endfor
</select> </select>
......
# -*- coding: utf-8 -*-
"""Constants used in the test suite. """ """Constants used in the test suite. """
SORTED_COUNTRIES = [ SORTED_COUNTRIES = [
(u'AF', u'Afghanistan'), (u"AF", u"Afghanistan"),
(u'AL', u'Albania'), (u"AX", u"Åland Islands"),
(u'DZ', u'Algeria'), (u"AL", u"Albania"),
(u'AS', u'American Samoa'), (u"DZ", u"Algeria"),
(u'AD', u'Andorra'), (u"AS", u"American Samoa"),
(u'AO', u'Angola'), (u"AD", u"Andorra"),
(u'AI', u'Anguilla'), (u"AO", u"Angola"),
(u'AQ', u'Antarctica'), (u"AI", u"Anguilla"),
(u'AG', u'Antigua and Barbuda'), (u"AQ", u"Antarctica"),
(u'AR', u'Argentina'), (u"AG", u"Antigua and Barbuda"),
(u'AM', u'Armenia'), (u"AR", u"Argentina"),
(u'AW', u'Aruba'), (u"AM", u"Armenia"),
(u'AU', u'Australia'), (u"AW", u"Aruba"),
(u'AT', u'Austria'), (u"AU", u"Australia"),
(u'AZ', u'Azerbaijan'), (u"AT", u"Austria"),
(u'BS', u'Bahamas'), (u"AZ", u"Azerbaijan"),
(u'BH', u'Bahrain'), (u"BS", u"Bahamas"),
(u'BD', u'Bangladesh'), (u"BH", u"Bahrain"),
(u'BB', u'Barbados'), (u"BD", u"Bangladesh"),
(u'BY', u'Belarus'), (u"BB", u"Barbados"),
(u'BE', u'Belgium'), (u"BY", u"Belarus"),
(u'BZ', u'Belize'), (u"BE", u"Belgium"),
(u'BJ', u'Benin'), (u"BZ", u"Belize"),
(u'BM', u'Bermuda'), (u"BJ", u"Benin"),
(u'BT', u'Bhutan'), (u"BM", u"Bermuda"),
(u'BO', u'Bolivia, Plurinational State of'), (u"BT", u"Bhutan"),
(u'BQ', u'Bonaire, Sint Eustatius and Saba'), (u"BO", u"Bolivia"),
(u'BA', u'Bosnia and Herzegovina'), (u"BQ", u"Bonaire, Sint Eustatius and Saba"),
(u'BW', u'Botswana'), (u"BA", u"Bosnia and Herzegovina"),
(u'BV', u'Bouvet Island'), (u"BW", u"Botswana"),
(u'BR', u'Brazil'), (u"BV", u"Bouvet Island"),
(u'IO', u'British Indian Ocean Territory'), (u"BR", u"Brazil"),
(u'BN', u'Brunei Darussalam'), (u"IO", u"British Indian Ocean Territory"),
(u'BG', u'Bulgaria'), (u"BN", u"Brunei"),
(u'BF', u'Burkina Faso'), (u"BG", u"Bulgaria"),
(u'BI', u'Burundi'), (u"BF", u"Burkina Faso"),
(u'KH', u'Cambodia'), (u"BI", u"Burundi"),
(u'CM', u'Cameroon'), (u"CV", u"Cabo Verde"),
(u'CA', u'Canada'), (u"KH", u"Cambodia"),
(u'CV', u'Cape Verde'), (u"CM", u"Cameroon"),
(u'KY', u'Cayman Islands'), (u"CA", u"Canada"),
(u'CF', u'Central African Republic'), (u"KY", u"Cayman Islands"),
(u'TD', u'Chad'), (u"CF", u"Central African Republic"),
(u'CL', u'Chile'), (u"TD", u"Chad"),
(u'CN', u'China'), (u"CL", u"Chile"),
(u'CX', u'Christmas Island'), (u"CN", u"China"),
(u'CC', u'Cocos (Keeling) Islands'), (u"CX", u"Christmas Island"),
(u'CO', u'Colombia'), (u"CC", u"Cocos (Keeling) Islands"),
(u'KM', u'Comoros'), (u"CO", u"Colombia"),
(u'CG', u'Congo'), (u"KM", u"Comoros"),
(u'CD', u'Congo (the Democratic Republic of the)'), (u"CG", u"Congo"),
(u'CK', u'Cook Islands'), (u"CD", u"Congo (the Democratic Republic of the)"),
(u'CR', u'Costa Rica'), (u"CK", u"Cook Islands"),
(u'HR', u'Croatia'), (u"CR", u"Costa Rica"),
(u'CU', u'Cuba'), (u"CI", u"Côte d'Ivoire"),
(u'CW', u'Cura\xe7ao'), (u"HR", u"Croatia"),
(u'CY', u'Cyprus'), (u"CU", u"Cuba"),
(u'CZ', u'Czech Republic'), (u"CW", u"Curaçao"),
(u'CI', u"C\xf4te d'Ivoire"), (u"CY", u"Cyprus"),
(u'DK', u'Denmark'), (u"CZ", u"Czech Republic"),
(u'DJ', u'Djibouti'), (u"DK", u"Denmark"),
(u'DM', u'Dominica'), (u"DJ", u"Djibouti"),
(u'DO', u'Dominican Republic'), (u"DM", u"Dominica"),
(u'EC', u'Ecuador'), (u"DO", u"Dominican Republic"),
(u'EG', u'Egypt'), (u"EC", u"Ecuador"),
(u'SV', u'El Salvador'), (u"EG", u"Egypt"),
(u'GQ', u'Equatorial Guinea'), (u"SV", u"El Salvador"),
(u'ER', u'Eritrea'), (u"GQ", u"Equatorial Guinea"),
(u'EE', u'Estonia'), (u"ER", u"Eritrea"),
(u'ET', u'Ethiopia'), (u"EE", u"Estonia"),
(u'FK', u'Falkland Islands [Malvinas]'), (u"ET", u"Ethiopia"),
(u'FO', u'Faroe Islands'), (u"FK", u"Falkland Islands [Malvinas]"),
(u'FJ', u'Fiji'), (u"FO", u"Faroe Islands"),
(u'FI', u'Finland'), (u"FJ", u"Fiji"),
(u'FR', u'France'), (u"FI", u"Finland"),
(u'GF', u'French Guiana'), (u"FR", u"France"),
(u'PF', u'French Polynesia'), (u"GF", u"French Guiana"),
(u'TF', u'French Southern Territories'), (u"PF", u"French Polynesia"),
(u'GA', u'Gabon'), (u"TF", u"French Southern Territories"),
(u'GM', u'Gambia (The)'), (u"GA", u"Gabon"),
(u'GE', u'Georgia'), (u"GM", u"Gambia"),
(u'DE', u'Germany'), (u"GE", u"Georgia"),
(u'GH', u'Ghana'), (u"DE", u"Germany"),
(u'GI', u'Gibraltar'), (u"GH", u"Ghana"),
(u'GR', u'Greece'), (u"GI", u"Gibraltar"),
(u'GL', u'Greenland'), (u"GR", u"Greece"),
(u'GD', u'Grenada'), (u"GL", u"Greenland"),
(u'GP', u'Guadeloupe'), (u"GD", u"Grenada"),
(u'GU', u'Guam'), (u"GP", u"Guadeloupe"),
(u'GT', u'Guatemala'), (u"GU", u"Guam"),
(u'GG', u'Guernsey'), (u"GT", u"Guatemala"),
(u'GN', u'Guinea'), (u"GG", u"Guernsey"),
(u'GW', u'Guinea-Bissau'), (u"GN", u"Guinea"),
(u'GY', u'Guyana'), (u"GW", u"Guinea-Bissau"),
(u'HT', u'Haiti'), (u"GY", u"Guyana"),
(u'HM', u'Heard Island and McDonald Islands'), (u"HT", u"Haiti"),
(u'VA', u'Holy See [Vatican City State]'), (u"HM", u"Heard Island and McDonald Islands"),
(u'HN', u'Honduras'), (u"VA", u"Holy See"),
(u'HK', u'Hong Kong'), (u"HN", u"Honduras"),
(u'HU', u'Hungary'), (u"HK", u"Hong Kong"),
(u'IS', u'Iceland'), (u"HU", u"Hungary"),
(u'IN', u'India'), (u"IS", u"Iceland"),
(u'ID', u'Indonesia'), (u"IN", u"India"),
(u'IR', u'Iran (the Islamic Republic of)'), (u"ID", u"Indonesia"),
(u'IQ', u'Iraq'), (u"IR", u"Iran"),
(u'IE', u'Ireland'), (u"IQ", u"Iraq"),
(u'IM', u'Isle of Man'), (u"IE", u"Ireland"),
(u'IL', u'Israel'), (u"IM", u"Isle of Man"),
(u'IT', u'Italy'), (u"IL", u"Israel"),
(u'JM', u'Jamaica'), (u"IT", u"Italy"),
(u'JP', u'Japan'), (u"JM", u"Jamaica"),
(u'JE', u'Jersey'), (u"JP", u"Japan"),
(u'JO', u'Jordan'), (u"JE", u"Jersey"),
(u'KZ', u'Kazakhstan'), (u"JO", u"Jordan"),
(u'KE', u'Kenya'), (u"KZ", u"Kazakhstan"),
(u'KI', u'Kiribati'), (u"KE", u"Kenya"),
(u'KP', u"Korea (the Democratic People's Republic of)"), (u"KI", u"Kiribati"),
(u'KR', u'Korea (the Republic of)'), (u"KW", u"Kuwait"),
(u'KW', u'Kuwait'), (u"KG", u"Kyrgyzstan"),
(u'KG', u'Kyrgyzstan'), (u"LA", u"Laos"),
(u'LA', u"Lao People's Democratic Republic"), (u"LV", u"Latvia"),
(u'LV', u'Latvia'), (u"LB", u"Lebanon"),
(u'LB', u'Lebanon'), (u"LS", u"Lesotho"),
(u'LS', u'Lesotho'), (u"LR", u"Liberia"),
(u'LR', u'Liberia'), (u"LY", u"Libya"),
(u'LY', u'Libya'), (u"LI", u"Liechtenstein"),
(u'LI', u'Liechtenstein'), (u"LT", u"Lithuania"),
(u'LT', u'Lithuania'), (u"LU", u"Luxembourg"),
(u'LU', u'Luxembourg'), (u"MO", u"Macao"),
(u'MO', u'Macao'), (u"MK", u"Macedonia"),
(u'MK', u'Macedonia (the former Yugoslav Republic of)'), (u"MG", u"Madagascar"),
(u'MG', u'Madagascar'), (u"MW", u"Malawi"),
(u'MW', u'Malawi'), (u"MY", u"Malaysia"),
(u'MY', u'Malaysia'), (u"MV", u"Maldives"),
(u'MV', u'Maldives'), (u"ML", u"Mali"),
(u'ML', u'Mali'), (u"MT", u"Malta"),
(u'MT', u'Malta'), (u"MH", u"Marshall Islands"),
(u'MH', u'Marshall Islands'), (u"MQ", u"Martinique"),
(u'MQ', u'Martinique'), (u"MR", u"Mauritania"),
(u'MR', u'Mauritania'), (u"MU", u"Mauritius"),
(u'MU', u'Mauritius'), (u"YT", u"Mayotte"),
(u'YT', u'Mayotte'), (u"MX", u"Mexico"),
(u'MX', u'Mexico'), (u"FM", u"Micronesia (Federated States of)"),
(u'FM', u'Micronesia (the Federated States of)'), (u"MD", u"Moldovia"),
(u'MD', u'Moldova (the Republic of)'), (u"MC", u"Monaco"),
(u'MC', u'Monaco'), (u"MN", u"Mongolia"),
(u'MN', u'Mongolia'), (u"ME", u"Montenegro"),
(u'ME', u'Montenegro'), (u"MS", u"Montserrat"),
(u'MS', u'Montserrat'), (u"MA", u"Morocco"),
(u'MA', u'Morocco'), (u"MZ", u"Mozambique"),
(u'MZ', u'Mozambique'), (u"MM", u"Myanmar"),
(u'MM', u'Myanmar'), (u"NA", u"Namibia"),
(u'NA', u'Namibia'), (u"NR", u"Nauru"),
(u'NR', u'Nauru'), (u"NP", u"Nepal"),
(u'NP', u'Nepal'), (u"NL", u"Netherlands"),
(u'NL', u'Netherlands'), (u"NC", u"New Caledonia"),
(u'NC', u'New Caledonia'), (u"NZ", u"New Zealand"),
(u'NZ', u'New Zealand'), (u"NI", u"Nicaragua"),
(u'NI', u'Nicaragua'), (u"NE", u"Niger"),
(u'NE', u'Niger'), (u"NG", u"Nigeria"),
(u'NG', u'Nigeria'), (u"NU", u"Niue"),
(u'NU', u'Niue'), (u"NF", u"Norfolk Island"),
(u'NF', u'Norfolk Island'), (u"KP", u"North Korea"),
(u'MP', u'Northern Mariana Islands'), (u"MP", u"Northern Mariana Islands"),
(u'NO', u'Norway'), (u"NO", u"Norway"),
(u'OM', u'Oman'), (u"OM", u"Oman"),
(u'PK', u'Pakistan'), (u"PK", u"Pakistan"),
(u'PW', u'Palau'), (u"PW", u"Palau"),
(u'PS', u'Palestine, State of'), (u"PS", u"Palestine, State of"),
(u'PA', u'Panama'), (u"PA", u"Panama"),
(u'PG', u'Papua New Guinea'), (u"PG", u"Papua New Guinea"),
(u'PY', u'Paraguay'), (u"PY", u"Paraguay"),
(u'PE', u'Peru'), (u"PE", u"Peru"),
(u'PH', u'Philippines'), (u"PH", u"Philippines"),
(u'PN', u'Pitcairn'), (u"PN", u"Pitcairn"),
(u'PL', u'Poland'), (u"PL", u"Poland"),
(u'PT', u'Portugal'), (u"PT", u"Portugal"),
(u'PR', u'Puerto Rico'), (u"PR", u"Puerto Rico"),
(u'QA', u'Qatar'), (u"QA", u"Qatar"),
(u'RO', u'Romania'), (u"RE", u"Réunion"),
(u'RU', u'Russian Federation'), (u"RO", u"Romania"),
(u'RW', u'Rwanda'), (u"RU", u"Russia"),
(u'RE', u'R\xe9union'), (u"RW", u"Rwanda"),
(u'BL', u'Saint Barth\xe9lemy'), (u"BL", u"Saint Barthélemy"),
(u'SH', u'Saint Helena, Ascension and Tristan da Cunha'), (u"SH", u"Saint Helena, Ascension and Tristan da Cunha"),
(u'KN', u'Saint Kitts and Nevis'), (u"KN", u"Saint Kitts and Nevis"),
(u'LC', u'Saint Lucia'), (u"LC", u"Saint Lucia"),
(u'MF', u'Saint Martin (French part)'), (u"MF", u"Saint Martin (French part)"),
(u'PM', u'Saint Pierre and Miquelon'), (u"PM", u"Saint Pierre and Miquelon"),
(u'VC', u'Saint Vincent and the Grenadines'), (u"VC", u"Saint Vincent and the Grenadines"),
(u'WS', u'Samoa'), (u"WS", u"Samoa"),
(u'SM', u'San Marino'), (u"SM", u"San Marino"),
(u'ST', u'Sao Tome and Principe'), (u"ST", u"Sao Tome and Principe"),
(u'SA', u'Saudi Arabia'), (u"SA", u"Saudi Arabia"),
(u'SN', u'Senegal'), (u"SN", u"Senegal"),
(u'RS', u'Serbia'), (u"RS", u"Serbia"),
(u'SC', u'Seychelles'), (u"SC", u"Seychelles"),
(u'SL', u'Sierra Leone'), (u"SL", u"Sierra Leone"),
(u'SG', u'Singapore'), (u"SG", u"Singapore"),
(u'SX', u'Sint Maarten (Dutch part)'), (u"SX", u"Sint Maarten (Dutch part)"),
(u'SK', u'Slovakia'), (u"SK", u"Slovakia"),
(u'SI', u'Slovenia'), (u"SI", u"Slovenia"),
(u'SB', u'Solomon Islands'), (u"SB", u"Solomon Islands"),
(u'SO', u'Somalia'), (u"SO", u"Somalia"),
(u'ZA', u'South Africa'), (u"ZA", u"South Africa"),
(u'GS', u'South Georgia and the South Sandwich Islands'), (u"GS", u"South Georgia and the South Sandwich Islands"),
(u'SS', u'South Sudan'), (u"KR", u"South Korea"),
(u'ES', u'Spain'), (u"SS", u"South Sudan"),
(u'LK', u'Sri Lanka'), (u"ES", u"Spain"),
(u'SD', u'Sudan'), (u"LK", u"Sri Lanka"),
(u'SR', u'Suriname'), (u"SD", u"Sudan"),
(u'SJ', u'Svalbard and Jan Mayen'), (u"SR", u"Suriname"),
(u'SZ', u'Swaziland'), (u"SJ", u"Svalbard and Jan Mayen"),
(u'SE', u'Sweden'), (u"SZ", u"Swaziland"),
(u'CH', u'Switzerland'), (u"SE", u"Sweden"),
(u'SY', u'Syrian Arab Republic'), (u"CH", u"Switzerland"),
(u'TW', u'Taiwan'), (u"SY", u"Syria"),
(u'TJ', u'Tajikistan'), (u"TW", u"Taiwan"),
(u'TZ', u'Tanzania, United Republic of'), (u"TJ", u"Tajikistan"),
(u'TH', u'Thailand'), (u"TZ", u"Tanzania"),
(u'TL', u'Timor-Leste'), (u"TH", u"Thailand"),
(u'TG', u'Togo'), (u"TL", u"Timor-Leste"),
(u'TK', u'Tokelau'), (u"TG", u"Togo"),
(u'TO', u'Tonga'), (u"TK", u"Tokelau"),
(u'TT', u'Trinidad and Tobago'), (u"TO", u"Tonga"),
(u'TN', u'Tunisia'), (u"TT", u"Trinidad and Tobago"),
(u'TR', u'Turkey'), (u"TN", u"Tunisia"),
(u'TM', u'Turkmenistan'), (u"TR", u"Turkey"),
(u'TC', u'Turks and Caicos Islands'), (u"TM", u"Turkmenistan"),
(u'TV', u'Tuvalu'), (u"TC", u"Turks and Caicos Islands"),
(u'UG', u'Uganda'), (u"TV", u"Tuvalu"),
(u'UA', u'Ukraine'), (u"UG", u"Uganda"),
(u'AE', u'United Arab Emirates'), (u"UA", u"Ukraine"),
(u'GB', u'United Kingdom'), (u"AE", u"United Arab Emirates"),
(u'US', u'United States'), (u"GB", u"United Kingdom of Great Britain and Northern Ireland"),
(u'UM', u'United States Minor Outlying Islands'), (u"UM", u"United States Minor Outlying Islands"),
(u'UY', u'Uruguay'), (u"US", u"United States of America"),
(u'UZ', u'Uzbekistan'), (u"UY", u"Uruguay"),
(u'VU', u'Vanuatu'), (u"UZ", u"Uzbekistan"),
(u'VE', u'Venezuela, Bolivarian Republic of'), (u"VU", u"Vanuatu"),
(u'VN', u'Viet Nam'), (u"VE", u"Venezuela"),
(u'VG', u'Virgin Islands (British)'), (u"VN", u"Vietnam"),
(u'VI', u'Virgin Islands (U.S.)'), (u"VG", u"Virgin Islands (British)"),
(u'WF', u'Wallis and Futuna'), (u"VI", u"Virgin Islands (U.S.)"),
(u'EH', u'Western Sahara'), (u"WF", u"Wallis and Futuna"),
(u'YE', u'Yemen'), (u"EH", u"Western Sahara"),
(u'ZM', u'Zambia'), (u"YE", u"Yemen"),
(u'ZW', u'Zimbabwe'), (u"ZM", u"Zambia"),
(u'AX', u'\xc5land Islands') (u"ZW", u"Zimbabwe"),
] ]
...@@ -581,22 +581,13 @@ class RegistrationView(APIView): ...@@ -581,22 +581,13 @@ class RegistrationView(APIView):
# Translators: This label appears above a dropdown menu on the registration # Translators: This label appears above a dropdown menu on the registration
# form used to select the country in which the user lives. # form used to select the country in which the user lives.
country_label = _(u"Country") country_label = _(u"Country")
sorted_countries = sorted(
countries.countries, key=lambda(__, name): unicode(name)
)
options = [
(country_code, unicode(country_name))
for country_code, country_name in sorted_countries
]
error_msg = _(u"Please select your Country.") error_msg = _(u"Please select your Country.")
form_desc.add_field( form_desc.add_field(
"country", "country",
label=country_label, label=country_label,
field_type="select", field_type="select",
options=options, options=list(countries),
include_default_option=True, include_default_option=True,
required=required, required=required,
error_messages={ error_messages={
......
...@@ -16,7 +16,7 @@ defusedxml==0.4.1 ...@@ -16,7 +16,7 @@ defusedxml==0.4.1
distribute>=0.6.28, <0.7 distribute>=0.6.28, <0.7
django-babel-underscore==0.1.0 django-babel-underscore==0.1.0
django-celery==3.1.16 django-celery==3.1.16
django-countries==2.1.2 django-countries==3.3
django-extensions==1.2.5 django-extensions==1.2.5
django-filter==0.6.0 django-filter==0.6.0
django-followit==0.0.3 django-followit==0.0.3
...@@ -88,6 +88,7 @@ xmltodict==0.4.1 ...@@ -88,6 +88,7 @@ xmltodict==0.4.1
django-ratelimit-backend==0.6 django-ratelimit-backend==0.6
unicodecsv==0.9.4 unicodecsv==0.9.4
django-require==1.0.6 django-require==1.0.6
pyuca==1.1
# Used for shopping cart's pdf invoice/receipt generation # Used for shopping cart's pdf invoice/receipt generation
reportlab==3.1.44 reportlab==3.1.44
......
...@@ -21,8 +21,6 @@ ...@@ -21,8 +21,6 @@
git+https://github.com/mitocw/django-cas.git@60a5b8e5a62e63e0d5d224a87f0b489201a0c695#egg=django-cas git+https://github.com/mitocw/django-cas.git@60a5b8e5a62e63e0d5d224a87f0b489201a0c695#egg=django-cas
-e git+https://github.com/dgrtwo/ParsePy.git@7949b9f754d1445eff8e8f20d0e967b9a6420639#egg=parse_rest -e git+https://github.com/dgrtwo/ParsePy.git@7949b9f754d1445eff8e8f20d0e967b9a6420639#egg=parse_rest
git+https://github.com/mfogel/django-settings-context-processor.git@b758c3930862761216267715a70bbefd206ac03a#egg=django-settings-context-processor==0.2 git+https://github.com/mfogel/django-settings-context-processor.git@b758c3930862761216267715a70bbefd206ac03a#egg=django-settings-context-processor==0.2
git+https://github.com/SmileyChris/pyuca.git@555292b39692e2c8a13fbba02a284fb89c9940e4#egg=pyuca==1.0
# Master pyfs has a bug working with VPC auth. This is a fix. We should switch # Master pyfs has a bug working with VPC auth. This is a fix. We should switch
# back to master when and if this fix is merged back. # back to master when and if this fix is merged back.
# fs==0.4.0 # fs==0.4.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment