Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #98 from larserikgk/master
Browse files Browse the repository at this point in the history
Changed str to unicode
  • Loading branch information
Torrib committed Feb 7, 2015
2 parents a3c0f17 + f0ea2fb commit 5f1549a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion apps/authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def set_password(request, token=None):

rt.delete()

messages.success(request, _(u"User ") + str(user) + _(u" successfully had it's password changed. You can now log in."))
messages.success(request, _(u"User ") + unicode(user) + _(u" successfully had it's password changed. You can now log in."))

return HttpResponseRedirect('/')
else:
Expand Down
2 changes: 1 addition & 1 deletion apps/competition/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def __unicode__(self):
if self.user:
return self.user.get_full_name()
else:
return str(self.team)
return unicode(self.team)

def is_team(self):
if self.user:
Expand Down
2 changes: 1 addition & 1 deletion apps/competition/templatetags/competition_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def render(self, context):

for competition in Competition.objects.filter(~Q(status=4)):
if competition.has_participant(user):
string += "<li><a href=\"" + competition.get_absolute_url() + "\">" + str(competition) + "</a></li>"
string += "<li><a href=\"" + competition.get_absolute_url() + "\">" + unicode(competition) + "</a></li>"
count += 1

if not count:
Expand Down
8 changes: 4 additions & 4 deletions apps/competition/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def join(request, competition_id):
# overridden by team signup, but not other way around
for team in teams:
if request.user == team.leader or request.user in team.members.all():
messages.error(request, _(u"You are already in this competition with ") + str(team))
messages.error(request, _(u"You are already in this competition with ") + unicode(team))
return redirect(competition)

# Checks that a form was posted, and if it contains a team id
Expand Down Expand Up @@ -196,7 +196,7 @@ def join(request, competition_id):
participant = Participant(user=request.user, competition=competition)
participant.save()

messages.success(request, _(u"You have been signed up for ") + str(competition))
messages.success(request, _(u"You have been signed up for ") + unicode(competition))
return redirect(competition)

@login_required
Expand All @@ -211,15 +211,15 @@ def leave(request, competition_id):
if request.user in competition.get_users():
participant = Participant.objects.get(user=request.user, competition=competition)
participant.delete()
messages.success(request, _(u"You are no longer participating in ") + str(competition))
messages.success(request, _(u"You are no longer participating in ") + unicode(competition))
else:
was_leader = False
for team in competition.get_teams():
if request.user == team.leader:
was_leader = True
participant = Participant.objects.get(team=team, competition=competition)
participant.delete()
messages.success(request, _(u"You have removed ") + str(team) + _(u" from ") + str(competition))
messages.success(request, _(u"You have removed ") + unicode(team) + _(u" from ") + unicode(competition))
if not was_leader:
messages.error(request, "You cannot remove %s from %s, you are not the team leader." % (team, competition))

Expand Down
2 changes: 1 addition & 1 deletion apps/sponsor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SponsorRelation(models.Model):
help_text="higher priority means closer to the top of the sponsor list.")

def __unicode__(self):
return str(self.lan) + " - " + str(self.sponsor)
return unicode(self.lan) + " - " + unicode(self.sponsor)

class Meta:
ordering = ['-priority']
2 changes: 1 addition & 1 deletion apps/team/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ def clean(self):

team = Team.objects.filter(tag=tag)
if team.count() > 0:
self._errors['tag'] = self.error_class([_(u"This team tag is taken. The team belongs to ") + str(team[0].leader)])
self._errors['tag'] = self.error_class([_(u"This team tag is taken. The team belongs to ") + unicode(team[0].leader)])

return cleaned_data
12 changes: 6 additions & 6 deletions apps/team/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def create_team(request):
)
team.save()

messages.success(request, str(team) + _(u" has been created."))
messages.success(request, unicode(team) + _(u" has been created."))
return redirect(team)
else:
form = TeamCreationForm(request.POST, auto_id=True, error_class=InlineSpanErrorList)
Expand All @@ -79,7 +79,7 @@ def disband_team(request, team_id):
else:
team.delete()

messages.success(request, str(team) + _(u" was successfully deleted."))
messages.success(request, unicode(team) + _(u" was successfully deleted."))
return redirect('teams')

def show_team(request, team_id):
Expand Down Expand Up @@ -116,14 +116,14 @@ def add_member(request, team_id):
user_id = request.POST.get("selectMember")
user = get_object_or_404(User, pk=user_id)
if len(Member.objects.filter(user=user, team=team)) > 0:
messages.error(request, str(user) + _(u" is already on your team."))
messages.error(request, unicode(user) + _(u" is already on your team."))
else:
member = Member()
member.team = team
member.user = user
member.save()

messages.success(request, str(user) + _(u' was added to your team'))
messages.success(request, unicode(user) + _(u' was added to your team'))

return redirect(team)

Expand All @@ -137,8 +137,8 @@ def remove_member(request, team_id, user_id):
member = get_object_or_404(Member, user=user, team=team)
member.delete()
if request.user == user:
messages.success(request, _(u'You have left team ') + str(team))
messages.success(request, _(u'You have left team ') + unicode(team))
else:
messages.success(request, str(user.username) + _(u" removed from your team."))
messages.success(request, unicode(user.username) + _(u" removed from your team."))

return redirect(team)

0 comments on commit 5f1549a

Please sign in to comment.