diff options
Diffstat (limited to 'pastepy.py')
-rw-r--r-- | pastepy.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -66,16 +66,16 @@ class Paste(object): }))] def add_paste(self, mp): - nick = mp['nick'].value - syntax = mp['syntax'].value or None - title = mp['title'].value - text = mp['text'].value + nick = mp['nick'].value.decode('utf8') or None + syntax = mp['syntax'].value.decode('utf8') or None + title = mp['title'].value.decode('utf8') or None + text = mp['text'].value.decode('utf8') or None hash = ''.join(random.choice(base62_alphabet) for x in xrange(5)) try: session = db.Session() - paste = db.Paste(hash, nick.decode('utf8'), datetime.datetime.utcnow(), syntax.decode('utf8') if syntax else None, title.decode('utf8'), text.decode('utf8')) + paste = db.Paste(hash, nick, datetime.datetime.utcnow(), syntax, title, text) session.add(paste) session.commit() finally: |