From 05de464fd2f287d8ea3a26560c18afcac32d7f1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Tue, 16 Sep 2008 11:08:44 +0200 Subject: [PATCH 1/1] Using slug from identifier.url instead of generating it from title for newly imported books. --- apps/catalogue/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index d8565c4bc..05009a5bc 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -137,7 +137,8 @@ class Book(models.Model): # Read book metadata book_info = dcparser.parse(xml_file) - book = Book(title=book_info.title, slug=slughifi(book_info.title)) + book_base, book_slug = book_info.url.rsplit('/', 1) + book = Book(title=book_info.title, slug=book_slug) book.save() book_tags = [] -- 2.20.1