fixed same bug for library thing loading

pull/1/head
eric 2012-01-16 20:25:36 -05:00
parent 6f11308ab9
commit 5dea6b7fea
1 changed files with 4 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import HTMLParser
import logging
import re
from datetime import datetime
from regluit.core import models
logger = logging.getLogger(__name__)
@ -214,10 +215,9 @@ def load_librarything_into_wishlist(user, lt_username, max_books=None):
if not edition:
continue
# add the librarything ids to the db since we know them now
edition.librarything_id = book['book_id']
edition.save()
edition.work.librarything_id = book['work_id']
edition.work.save()
identifier= models.Identifier.get_or_add(type = 'thng', value = book['book_id'], edition = edition, work = edition.work)
identifier= models.Identifier.get_or_add(type = 'ltwk', value = book['work_id'], work = edition.work)
user.wishlist.add_work(edition.work, 'librarything')
if edition.new:
regluit.core.tasks.populate_edition.delay(edition)