summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2019-02-06 18:42:47 +0000
committerMagnus Hagander2019-02-06 19:01:54 +0000
commit37248717c373033626fae7396bc8ac47374abb30 (patch)
tree4362791317c42faf160ea0f6b5f51b0718abac03
parent12c3439a992475b2b09b57dafb1435b81709d6ee (diff)
Unicode fixes for python 3
-rw-r--r--pgcommitfest/commitfest/feeds.py6
-rw-r--r--pgcommitfest/commitfest/lookups.py4
-rw-r--r--pgcommitfest/commitfest/models.py14
-rw-r--r--pgcommitfest/mailqueue/models.py2
-rw-r--r--pgcommitfest/userprofile/models.py6
-rw-r--r--pgcommitfest/userprofile/util.py2
6 files changed, 17 insertions, 17 deletions
diff --git a/pgcommitfest/commitfest/feeds.py b/pgcommitfest/commitfest/feeds.py
index cd206ac..969de69 100644
--- a/pgcommitfest/commitfest/feeds.py
+++ b/pgcommitfest/commitfest/feeds.py
@@ -21,13 +21,13 @@ class ActivityFeed(Feed):
if self.cfid:
return item['name']
else:
- return u'{cfname}: {name}'.format(**item)
+ return '{cfname}: {name}'.format(**item)
def item_description(self, item):
if self.cfid:
- return u"<div>Patch: {name}</div><div>User: {by}</div>\n<div>{what}</div>".format(**item)
+ return "<div>Patch: {name}</div><div>User: {by}</div>\n<div>{what}</div>".format(**item)
else:
- return u"<div>Commitfest: {cfname}</div><div>Patch: {name}</div><div>User: {by}</div><div>{what}</div>".format(**item)
+ return "<div>Commitfest: {cfname}</div><div>Patch: {name}</div><div>User: {by}</div><div>{what}</div>".format(**item)
def item_link(self, item):
if self.cfid:
diff --git a/pgcommitfest/commitfest/lookups.py b/pgcommitfest/commitfest/lookups.py
index 7297ccc..33e2b4e 100644
--- a/pgcommitfest/commitfest/lookups.py
+++ b/pgcommitfest/commitfest/lookups.py
@@ -16,11 +16,11 @@ class UserLookup(ModelLookup):
def get_item_value(self, item):
# Display for currently selected item
- return u"%s (%s)" % (item.username, item.get_full_name())
+ return "%s (%s)" % (item.username, item.get_full_name())
def get_item_label(self, item):
# Display for choice listings
- return u"%s (%s)" % (item.username, item.get_full_name())
+ return "%s (%s)" % (item.username, item.get_full_name())
registry.register(UserLookup)
diff --git a/pgcommitfest/commitfest/models.py b/pgcommitfest/commitfest/models.py
index 5a8de34..b59d754 100644
--- a/pgcommitfest/commitfest/models.py
+++ b/pgcommitfest/commitfest/models.py
@@ -15,8 +15,8 @@ class Committer(models.Model):
user = models.OneToOneField(User, null=False, blank=False, primary_key=True)
active = models.BooleanField(null=False, blank=False, default=True)
- def __unicode__(self):
- return unicode(self.user)
+ def __str__(self):
+ return str(self.user)
@property
def fullname(self):
@@ -60,7 +60,7 @@ class CommitFest(models.Model):
def isopen(self):
return self.status == self.STATUS_OPEN
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -71,7 +71,7 @@ class CommitFest(models.Model):
class Topic(models.Model):
topic = models.CharField(max_length=100, blank=False, null=False)
- def __unicode__(self):
+ def __str__(self):
return self.topic
@@ -142,7 +142,7 @@ class Patch(models.Model, DiffableModel):
else:
self.lastmail = max(threads, key=lambda t: t.latestmessage).latestmessage
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -215,7 +215,7 @@ class PatchHistory(models.Model):
def by_string(self):
return "%s %s (%s)" % (self.by.first_name, self.by.last_name, self.by.username)
- def __unicode__(self):
+ def __str__(self):
return "%s - %s" % (self.patch.name, self.date)
class Meta:
@@ -277,7 +277,7 @@ class MailThread(models.Model):
latestsubject = models.CharField(max_length=500, null=False, blank=False)
latestmsgid = models.CharField(max_length=1000, null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return self.subject
class Meta:
diff --git a/pgcommitfest/mailqueue/models.py b/pgcommitfest/mailqueue/models.py
index 1a0642a..6b002e7 100644
--- a/pgcommitfest/mailqueue/models.py
+++ b/pgcommitfest/mailqueue/models.py
@@ -8,5 +8,5 @@ class QueuedMail(models.Model):
# anything, we just push them right in there!
fullmsg = models.TextField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s: %s -> %s" % (self.pk, self.sender, self.receiver)
diff --git a/pgcommitfest/userprofile/models.py b/pgcommitfest/userprofile/models.py
index 759df48..6d450a5 100644
--- a/pgcommitfest/userprofile/models.py
+++ b/pgcommitfest/userprofile/models.py
@@ -9,7 +9,7 @@ class UserExtraEmail(models.Model):
token = models.CharField(max_length=100, null=False, blank=True)
tokensent = models.DateTimeField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return self.email
class Meta:
@@ -28,5 +28,5 @@ class UserProfile(models.Model):
notify_all_reviewer = models.BooleanField(null=False, blank=False, default=False, verbose_name="Notify on all where reviewer")
notify_all_committer = models.BooleanField(null=False, blank=False, default=False, verbose_name="Notify on all where committer")
- def __unicode__(self):
- return unicode(self.user)
+ def __str__(self):
+ return str(self.user)
diff --git a/pgcommitfest/userprofile/util.py b/pgcommitfest/userprofile/util.py
index bd14a3e..e08aa66 100644
--- a/pgcommitfest/userprofile/util.py
+++ b/pgcommitfest/userprofile/util.py
@@ -36,5 +36,5 @@ class UserWrapper(object):
@property
def encoded_email_header(self):
return formataddr((
- str(Header(u"%s %s" % (self.user.first_name, self.user.last_name), 'utf-8')),
+ str(Header("%s %s" % (self.user.first_name, self.user.last_name), 'utf-8')),
self.email))