From: Marcin Koziej Date: Thu, 22 Dec 2011 12:25:26 +0000 (+0100) Subject: fix broken publishing\ X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/4fa05f4b9dc3567ab66a7a3a4827ea64b582a4ee?ds=inline;hp=-c fix broken publishing\ --- 4fa05f4b9dc3567ab66a7a3a4827ea64b582a4ee diff --git a/apps/api/tests.py b/apps/api/tests.py index 74417acb9..5a981a26a 100644 --- a/apps/api/tests.py +++ b/apps/api/tests.py @@ -10,9 +10,10 @@ from api.helpers import timestamp from catalogue.models import Book, Tag from picture.tests.utils import RequestFactory from picture.forms import PictureImportForm -from picture.models import Picture +from picture.models import Picture, picture_storage import picture.tests from django.core.files.uploadedfile import SimpleUploadedFile + from os import path @@ -160,3 +161,4 @@ class PictureTests(ApiTest): import_form.save() pic = Picture.objects.get(slug=slug) + diff --git a/apps/picture/models.py b/apps/picture/models.py index 3cb1d8973..8aa6f975c 100644 --- a/apps/picture/models.py +++ b/apps/picture/models.py @@ -80,7 +80,7 @@ class Picture(models.Model): """ from sortify import sortify from django.core.files import File - from librarian.picture import WLPicture + from librarian.picture import WLPicture, ImageStore close_xml_file = False close_image_file = False # class SimpleImageStore(object): @@ -98,7 +98,8 @@ class Picture(models.Model): try: # use librarian to parse meta-data - picture_xml = WLPicture.from_file(xml_file) + picture_xml = WLPicture.from_file(xml_file, + image_store=ImageStore(picture_storage.path('images'))) # image_store=SimpleImageStore picture, created = Picture.objects.get_or_create(slug=picture_xml.slug) diff --git a/lib/librarian b/lib/librarian index ef1261dbe..5fed78856 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit ef1261dbe0b30a1ab9f39831b7c167918913338a +Subproject commit 5fed78856949474a36bc5e268517775a9a802e27