fixed goodreads loader
parent
789b3ec118
commit
6f11308ab9
|
@ -13,6 +13,7 @@ import django.utils.encoding
|
||||||
|
|
||||||
import regluit.core
|
import regluit.core
|
||||||
from regluit.core import bookloader
|
from regluit.core import bookloader
|
||||||
|
from regluit.core import models
|
||||||
|
|
||||||
# import parse_qsl from cgi if it doesn't exist in urlparse
|
# import parse_qsl from cgi if it doesn't exist in urlparse
|
||||||
try:
|
try:
|
||||||
|
@ -286,8 +287,7 @@ def load_goodreads_shelf_into_wishlist(user, shelf_name='all', goodreads_user_id
|
||||||
link = review['book']['link']
|
link = review['book']['link']
|
||||||
match = re.search('/show/(\d+)', link)
|
match = re.search('/show/(\d+)', link)
|
||||||
if match:
|
if match:
|
||||||
edition.goodreads_id = match.group(1)
|
identifier= models.Identifier.get_or_add(type = 'gdrd', value = match.group(1), edition = edition, work = edition.work)
|
||||||
edition.save()
|
|
||||||
user.wishlist.add_work(edition.work, 'goodreads')
|
user.wishlist.add_work(edition.work, 'goodreads')
|
||||||
logger.info("Work with isbn %s added to wishlist.", isbn)
|
logger.info("Work with isbn %s added to wishlist.", isbn)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue