Django

Code

Changeset 5257

Show
Ignore:
Timestamp:
05/16/07 08:24:18 (2 years ago)
Author:
mtredinnick
Message:

unicode: Audited comment app. Only a couple of minor changes needed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode/django/contrib/comments/feeds.py

    r4265 r5257  
    1212        if not hasattr(self, '_site'): 
    1313            self._site = Site.objects.get_current() 
    14         return "%s comments" % self._site.name 
     14        return u"%s comments" % self._site.name 
    1515 
    1616    def link(self): 
     
    2222        if not hasattr(self, '_site'): 
    2323            self._site = Site.objects.get_current() 
    24         return "Latest comments on %s" % self._site.name 
     24        return u"Latest comments on %s" % self._site.name 
    2525 
    2626    def items(self): 
  • django/branches/unicode/django/contrib/comments/views/comments.py

    r5229 r5257  
    1313from django.conf import settings 
    1414from django.utils.translation import ungettext, ugettext as _ 
     15from django.utils.encoding import smart_unicode 
    1516import base64, datetime 
    1617 
     
    249250        # serve up the "Thanks for posting" page as if the comment WAS posted. 
    250251        if request.META['REMOTE_ADDR'] in settings.BANNED_IPS: 
    251             mail_admins("Banned IP attempted to post comment", str(request.POST) + "\n\n" + str(request.META)) 
     252            mail_admins("Banned IP attempted to post comment", smart_unicode(request.POST) + "\n\n" + str(request.META)) 
    252253        else: 
    253254            manipulator.do_html2python(new_data) 
     
    313314        if request.META['REMOTE_ADDR'] in settings.BANNED_IPS: 
    314315            from django.core.mail import mail_admins 
    315             mail_admins("Practical joker", str(request.POST) + "\n\n" + str(request.META)) 
     316            mail_admins("Practical joker", smart_unicode(request.POST) + "\n\n" + str(request.META)) 
    316317        else: 
    317318            manipulator.do_html2python(new_data)