From ad11c1b6f4bb1d16ea418379bb69dcd2bafc96d6 Mon Sep 17 00:00:00 2001 From: Will Daly Date: Tue, 14 Oct 2014 10:25:34 -0400 Subject: [PATCH] Update django-countries to 2.1.2, override country name for Taiwan --- common/djangoapps/student/models.py | 2 +- lms/envs/common.py | 9 +++++++-- lms/templates/register-shib.html | 2 +- lms/templates/register.html | 4 ++-- lms/templates/signup_modal.html | 2 +- requirements/edx/base.txt | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index 24a122e9a5..70691adf28 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -31,7 +31,7 @@ from django.db.models import Count from django.dispatch import receiver, Signal from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext_noop -from django_countries import CountryField +from django_countries.fields import CountryField from config_models.models import ConfigurationModel from track import contexts from eventtracking import tracker diff --git a/lms/envs/common.py b/lms/envs/common.py index c5dea04781..8886b053f5 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -27,14 +27,13 @@ Longer TODO: import sys import os import imp -import json from path import path from warnings import simplefilter +from django.utils.translation import ugettext_lazy as _ from .discussionsettings import * from xmodule.modulestore.modulestore_settings import update_module_store_settings - from lms.lib.xblock.mixin import LmsBlockMixin ################################### FEATURES ################################### @@ -1838,3 +1837,9 @@ AUTO_REGISTRATION_AB_TEST_EXCLUDE_COURSES = set([ # REGISTRATION CODES DISPLAY INFORMATION SUBTITUTIONS IN THE INVOICE ATTACHMENT INVOICE_CORP_ADDRESS = "Please place your corporate address\nin this configuration" INVOICE_PAYMENT_INSTRUCTIONS = "This is where you can\nput directions on how people\nbuying registration codes" + +# Country code overrides +# Used by django-countries +COUNTRIES_OVERRIDE = { + "TW": _("Taiwan"), +} diff --git a/lms/templates/register-shib.html b/lms/templates/register-shib.html index f192f85ba6..f0bc8efe15 100644 --- a/lms/templates/register-shib.html +++ b/lms/templates/register-shib.html @@ -7,7 +7,7 @@ <%! from django.core.urlresolvers import reverse %> <%! from django.utils import html %> -<%! from django_countries.countries import COUNTRIES %> +<%! from django_countries import countries %> <%! from student.models import UserProfile %> <%! from datetime import date %> <%! import calendar %> diff --git a/lms/templates/register.html b/lms/templates/register.html index 23cf6e06a0..13cb548f61 100644 --- a/lms/templates/register.html +++ b/lms/templates/register.html @@ -8,7 +8,7 @@ <%! from django.core.urlresolvers import reverse %> <%! from django.utils import html %> -<%! from django_countries.countries import COUNTRIES %> +<%! from django_countries import countries %> <%! from django.utils.translation import ugettext as _ %> <%! from student.models import UserProfile %> <%! from datetime import date %> @@ -254,7 +254,7 @@ diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html index efe2622f6f..5f65114cfb 100644 --- a/lms/templates/signup_modal.html +++ b/lms/templates/signup_modal.html @@ -3,7 +3,7 @@ <%namespace name='static' file='static_content.html'/> <%! from django.conf import settings %> <%! from django.core.urlresolvers import reverse %> -<%! from django_countries.countries import COUNTRIES %> +<%! from django_countries import countries %> <%! from student.models import UserProfile %> <%! from datetime import date %> <%! import calendar %> diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 71d8ba6abd..5919c38b97 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -16,7 +16,7 @@ defusedxml==0.4.1 distribute>=0.6.28, <0.7 django-babel-underscore==0.1.0 django-celery==3.0.17 -django-countries==1.5 +django-countries==2.1.2 django-extensions==1.2.5 django-filter==0.6.0 django-followit==0.0.3