Commit 5bdafcc7 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis Committed by Georgios D. Tsoukalas

Encode unicode strings in __str__

parent af485f68
......@@ -163,7 +163,7 @@ def chain_info(chain_dict):
d = {
'projectid' : str(chain),
'name' : str(project.application.name if project else app.name),
'name' : project.application.name if project else app.name,
'applicant' : app.applicant.realname,
'email' : app.applicant.email,
'status': status,
......
......@@ -83,6 +83,7 @@ from .managers import ForUpdateManager
from synnefo.lib.quotaholder.api import QH_PRACTICALLY_INFINITE
from synnefo.lib.db.intdecimalfield import intDecimalField
from synnefo.util.text import uenc, udec
logger = logging.getLogger(__name__)
......@@ -1892,10 +1893,14 @@ class Project(models.Model):
Q_DEACTIVATED = Q_TERMINATED | Q_SUSPENDED
def __str__(self):
return _("<project %s '%s'>") % (self.id, self.application.name)
return uenc(_("<project %s '%s'>") %
(self.id, udec(self.application.name)))
__repr__ = __str__
def __unicode__(self):
return _("<project %s '%s'>") % (self.id, self.application.name)
STATE_DISPLAY = {
APPROVED : 'Active',
SUSPENDED : 'Suspended',
......@@ -2180,8 +2185,8 @@ class ProjectMembership(models.Model):
#index_together = [["project", "state"]]
def __str__(self):
return _("<'%s' membership in '%s'>") % (
self.person.username, self.project)
return uenc(_("<'%s' membership in '%s'>") % (
self.person.username, self.project))
__repr__ = __str__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment