fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
librarian update
[redakcja.git]
/
apps
/
catalogue
/
models
/
image.py
diff --git
a/apps/catalogue/models/image.py
b/apps/catalogue/models/image.py
index
90a6e02
..
558f4c1
100755
(executable)
--- a/
apps/catalogue/models/image.py
+++ b/
apps/catalogue/models/image.py
@@
-69,7
+69,9
@@
class Image(dvcs_models.Document):
"""Returns own file object. Ignores slug ad mime_type."""
return open(self.image.path)
"""Returns own file object. Ignores slug ad mime_type."""
return open(self.image.path)
- picture_xml = self.publishable().materialize()
+ publishable = self.publishable()
+ assert publishable, _("There is no publishable revision")
+ picture_xml = publishable.materialize()
try:
picture = WLPicture.from_string(picture_xml.encode('utf-8'),
try:
picture = WLPicture.from_string(picture_xml.encode('utf-8'),
@@
-82,8
+84,8
@@
class Image(dvcs_models.Document):
raise AssertionError(_('Invalid Dublin Core') + ': ' + str(e))
valid_about = self.correct_about()
raise AssertionError(_('Invalid Dublin Core') + ': ' + str(e))
valid_about = self.correct_about()
- assert
(picture.picture_info.about == valid_about,
- _("rdf:about is not") + " " + valid_about
)
+ assert
picture.picture_info.about == valid_about, \
+ _("rdf:about is not") + " " + valid_about
def accessible(self, request):
return self.public or request.user.is_authenticated()
def accessible(self, request):
return self.public or request.user.is_authenticated()