summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/orm/models.py
diff options
context:
space:
mode:
authorSujith H <sujith.h@gmail.com>2016-03-08 18:09:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-09 22:45:16 +0000
commitcc74a8ae26a7728828a3442ba441b1676bc2c8a1 (patch)
tree5a8ce987f308378274a7bc5caa51996eb1234106 /bitbake/lib/toaster/orm/models.py
parentaebc22dbfade9a107f1a05e42bf7fe3887c15ae8 (diff)
downloadpoky-cc74a8ae26a7728828a3442ba441b1676bc2c8a1.tar.gz
bitbake: toaster: use force_bytes to display non-ascii project names
When user enters a non-ascii character in the project name of toaster, the build doesn't get triggered. Use force_bytes to fix this. Also deal with non-ascii project names when logging the build request in runbuilds. [YOCTO #9071] (Bitbake rev: b6141c4d170885d3bdf63074afcb1e41fde0a8f0) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/orm/models.py')
-rw-r--r--bitbake/lib/toaster/orm/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 93b5df3d4e..f9c4fb0508 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -19,9 +19,12 @@
19# with this program; if not, write to the Free Software Foundation, Inc., 19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 21
22from __future__ import unicode_literals
23
22from django.db import models, IntegrityError 24from django.db import models, IntegrityError
23from django.db.models import F, Q, Avg, Max, Sum 25from django.db.models import F, Q, Avg, Max, Sum
24from django.utils import timezone 26from django.utils import timezone
27from django.utils.encoding import force_bytes
25 28
26from django.core.urlresolvers import reverse 29from django.core.urlresolvers import reverse
27 30
@@ -1614,7 +1617,7 @@ class LogMessage(models.Model):
1614 lineno = models.IntegerField(null=True) 1617 lineno = models.IntegerField(null=True)
1615 1618
1616 def __str__(self): 1619 def __str__(self):
1617 return "%s %s %s" % (self.get_level_display(), self.message, self.build) 1620 return force_bytes('%s %s %s' % (self.get_level_display(), self.message, self.build))
1618 1621
1619def invalidate_cache(**kwargs): 1622def invalidate_cache(**kwargs):
1620 from django.core.cache import cache 1623 from django.core.cache import cache