diff options
author | Sujith H <sujith.h@gmail.com> | 2016-03-08 18:09:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-09 22:42:45 +0000 |
commit | b6141c4d170885d3bdf63074afcb1e41fde0a8f0 (patch) | |
tree | feba8e7902c7222bcf3ddd35a30a2a04360797ab /lib/toaster/bldcontrol/models.py | |
parent | ba011470df0ea8bd89f01c0b02ec4b3969e60ce7 (diff) | |
download | bitbake-b6141c4d170885d3bdf63074afcb1e41fde0a8f0.tar.gz |
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]
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 'lib/toaster/bldcontrol/models.py')
-rw-r--r-- | lib/toaster/bldcontrol/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/toaster/bldcontrol/models.py b/lib/toaster/bldcontrol/models.py index 9244ed1d8..9b2d0d0b2 100644 --- a/lib/toaster/bldcontrol/models.py +++ b/lib/toaster/bldcontrol/models.py @@ -1,5 +1,7 @@ +from __future__ import unicode_literals from django.db import models from django.core.validators import MaxValueValidator, MinValueValidator +from django.utils.encoding import force_bytes from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version # a BuildEnvironment is the equivalent of the "build/" directory on the localhost @@ -94,7 +96,7 @@ class BuildRequest(models.Model): return self.brvariable_set.get(name="MACHINE").value def __str__(self): - return "%s %s" % (self.project, self.get_state_display()) + return force_bytes('%s %s' % (self.project, self.get_state_display())) # These tables specify the settings for running an actual build. # They MUST be kept in sync with the tables in orm.models.Project* |