(sort of) FIX: publishing items whose headlines contained umlauts previously resulted in an exception

This commit is contained in:
phear 2011-12-16 13:11:10 +00:00
parent b7207881cd
commit 3bfebb9e99

View file

@ -165,6 +165,9 @@ class Poll(sqlobject.SQLObject):
complete_url = self.get_url(absolute=True)
title = "%s %s %s" % (config.get('misc', 'twitter_alert_prefix'),
self.title[:79], complete_url)
# the following line is quick and dirty fix for the unicode bug twitter exception.
# of course it would be better to preserve the umlauts somehow...
title = title.encode('ascii','ignore')
twitter_key = config.get('misc', 'twitter_consumer_key')
twitter_secret = config.get('misc', 'twitter_consumer_secret')
twitter_access_key = config.get('misc', 'twitter_access_token_key')