0001-fix-UnicodeEncodeError-in-UserCredentials-Model.patch
mandayejs/mandaye/models.py | ||
---|---|---|
13 | 13 |
# |
14 | 14 |
# You should have received a copy of the GNU Affero General Public License |
15 | 15 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 |
from __future__ import unicode_literals |
|
17 | ||
16 | 18 | |
17 | 19 |
from django.db import models |
18 | 20 |
from jsonfield import JSONField |
... | ... | |
28 | 30 |
unique_together = ('user',) |
29 | 31 | |
30 | 32 |
def __str__(self): |
31 |
return self.user.get_full_name() or self.user.email or self.user.username |
|
33 |
return self.user.get_full_name().encode('utf-8') \ |
|
34 |
or self.user.email.encode('utf-8') \ |
|
35 |
or self.user.username.encode('utf-8') |
|
32 | 36 | |
33 | 37 |
def to_login_info(self): |
34 | 38 |
return {'#'+k : v for k,v in self.locators.items() if k != 'csrfmiddlewaretoken' } |
35 |
- |