From 3615ffb336a57f60f62b44fb264c598ce2a46373 Mon Sep 17 00:00:00 2001 From: tkupek Date: Sat, 19 Mar 2016 19:17:49 +0100 Subject: [PATCH] temporary fix for unicode error with users --- tkupek_elearning/elearning/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tkupek_elearning/elearning/models.py b/tkupek_elearning/elearning/models.py index fe455a2..e3978c7 100644 --- a/tkupek_elearning/elearning/models.py +++ b/tkupek_elearning/elearning/models.py @@ -1,3 +1,4 @@ +# coding=utf-8 from __future__ import unicode_literals import hashlib @@ -78,7 +79,7 @@ class UserAnswer(models.Model): correct = models.NullBooleanField(null=True) def __unicode__(self): - return str(self.user) + " - " + str(self.question.id) + return "" class Meta: unique_together = (('user', 'question'),) @@ -92,4 +93,4 @@ class UserAnswerOptions(models.Model): unique_together = (('user_answer', 'option'),) def __unicode__(self): - return str(self.user_answer) + " - " + str(self.option) + return unicode(str(self.user_answer) + " - " + str(self.option), "utf-8")