diff --git a/openedx/core/djangoapps/embargo/models.py b/openedx/core/djangoapps/embargo/models.py index a920a1817a..3cbd93b255 100644 --- a/openedx/core/djangoapps/embargo/models.py +++ b/openedx/core/djangoapps/embargo/models.py @@ -375,6 +375,7 @@ class RestrictedCourse(models.Model): log.info("Invalidated cached messaging URLs ") +@python_2_unicode_compatible class Country(models.Model): """Representation of a country. @@ -389,7 +390,7 @@ class Country(models.Model): help_text=ugettext_lazy(u"Two character ISO country code.") ) - def __unicode__(self): + def __str__(self): return u"{name} ({code})".format( name=six.text_type(self.country.name), code=six.text_type(self.country) @@ -400,6 +401,7 @@ class Country(models.Model): ordering = ['country'] +@python_2_unicode_compatible class CountryAccessRule(models.Model): """Course access rule based on the user's country. @@ -522,7 +524,7 @@ class CountryAccessRule(models.Model): # that have access to the course. return list(whitelist_countries - blacklist_countries) - def __unicode__(self): + def __str__(self): if self.rule_type == self.WHITELIST_RULE: return _(u"Whitelist {country} for {course}").format( course=six.text_type(self.restricted_course.course_key),