python 3 fixes
This commit is contained in:
@@ -40,6 +40,7 @@ from django.utils.functional import cached_property
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.utils.translation import ugettext_noop
|
from django.utils.translation import ugettext_noop
|
||||||
from django_countries.fields import CountryField
|
from django_countries.fields import CountryField
|
||||||
|
from django.utils.encoding import python_2_unicode_compatible
|
||||||
from edx_django_utils.cache import RequestCache
|
from edx_django_utils.cache import RequestCache
|
||||||
from edx_rest_api_client.exceptions import SlumberBaseException
|
from edx_rest_api_client.exceptions import SlumberBaseException
|
||||||
from eventtracking import tracker
|
from eventtracking import tracker
|
||||||
@@ -2813,6 +2814,7 @@ class RegistrationCookieConfiguration(ConfigurationModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@python_2_unicode_compatible
|
||||||
class UserAttribute(TimeStampedModel):
|
class UserAttribute(TimeStampedModel):
|
||||||
"""
|
"""
|
||||||
Record additional metadata about a user, stored as key/value pairs of text.
|
Record additional metadata about a user, stored as key/value pairs of text.
|
||||||
@@ -2828,12 +2830,11 @@ class UserAttribute(TimeStampedModel):
|
|||||||
name = models.CharField(max_length=255, help_text=_("Name of this user attribute."), db_index=True)
|
name = models.CharField(max_length=255, help_text=_("Name of this user attribute."), db_index=True)
|
||||||
value = models.CharField(max_length=255, help_text=_("Value of this user attribute."))
|
value = models.CharField(max_length=255, help_text=_("Value of this user attribute."))
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
"""Unicode representation of this attribute. """
|
return "[{username}] {name}: {value}".format(
|
||||||
return u"[{username}] {name}: {value}".format(
|
|
||||||
name=self.name,
|
name=self.name,
|
||||||
value=self.value,
|
value=self.value,
|
||||||
username=self.user.username,
|
username=self.user.username
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user