Use format for strings instead of %.

This commit is contained in:
cahrens
2013-07-25 12:21:17 -04:00
parent 1da5af53d9
commit 60d60de2c4
3 changed files with 3 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ class CourseCreator(models.Model):
"why course creation access was denied)"))
def __unicode__(self):
return u'%s | %s [%s]' % (self.user, self.state, self.state_changed)
return u"{0} | {1} [{2}]".format(self.user, self.state, self.state_changed)
@receiver(post_init, sender=CourseCreator)

View File

@@ -17,7 +17,7 @@
<div class="msg">
<h2 class="title">${_("Your account is already active")}</h2>
<div class="copy">
<p>${_("This account, set up using (%(email)s), has already been activated. Please sign in to start working within edX Studio.") % dict(email=user.email)}</p>
<p>${_("This account, set up using {0}, has already been activated. Please sign in to start working within edX Studio.".format(user.email))}</p>
</div>
</div>

View File

@@ -95,7 +95,7 @@
<article class="content-primary" role="main">
<div class="introduction">
<h2 class="title">${_("Welcome, %(name)s!") % dict(name= user.username)}</h2>
<h2 class="title">${_("Welcome, {0}!".format(user.username))}</h2>
%if len(courses) > 0:
<div class="copy">