From 20f82dcfcdc757dbd842abd5d7fbbd6d9bbb66c0 Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Sun, 8 Sep 2013 17:37:26 +0200 Subject: [PATCH] fix disqus import --- isso/migrate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/isso/migrate.py b/isso/migrate.py index c5d4c38..e157f64 100644 --- a/isso/migrate.py +++ b/isso/migrate.py @@ -12,6 +12,7 @@ from __future__ import division import sys import os +import hashlib from time import mktime, strptime from urlparse import urlparse @@ -35,10 +36,11 @@ def insert(db, thread, comments): parent = remap.get(item.get('dsq:parent')) comment = Comment(created=item['created'], text=item['text'], - author=item['author'], email=item['email'], parent=parent) + author=item['author'], parent=parent, + hash=hashlib.md5(item["email"] or '').hexdigest()) - rv = db.add(path, comment) - remap[item['dsq:id']] = rv.id + rv = db.add(path, comment, '127.0.0.1') + remap[item['dsq:id']] = rv["id"] def disqus(db, xmlfile):