X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/6a259b96cff47e1fd64cbfd6f3d1e1d8e8b6486c..4cdc0fc88d27843994fb6203eb4e5898f46c2c83:/apps/catalogue/models/book.py?ds=inline diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 9f809b86..db52128d 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -99,7 +99,7 @@ class Book(models.Model): # if there are more parts, set the rest to empty strings book_len = len(instance) for i in range(book_len - len(texts)): - texts.append(u'pusta część %d' % (i + 1), u'') + texts.append((u'pusta część %d' % (i + 1), u'')) i = 0 for i, (title, text) in enumerate(texts): @@ -110,8 +110,8 @@ class Book(models.Model): if i < book_len: chunk = instance[i] - chunk.slug = slug - chunk.title = title + chunk.slug = slug[:50] + chunk.title = title[:255] chunk.save() else: chunk = instance.add(slug, title, adjust_slug=True) @@ -278,6 +278,8 @@ class Book(models.Model): """ Publishes a book on behalf of a (local) user. """ + raise NotImplementedError("Publishing not possible yet.") + from apiclient import api_call changes = self.get_current_changes(publishable=True)