fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor upgrades.
[redakcja.git]
/
src
/
catalogue
/
models
/
image.py
diff --git
a/src/catalogue/models/image.py
b/src/catalogue/models/image.py
index
34f61f9
..
dbe1c04
100755
(executable)
--- a/
src/catalogue/models/image.py
+++ b/
src/catalogue/models/image.py
@@
-1,5
+1,3
@@
-# -*- coding: utf-8 -*-
-#
# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
@@
-38,7
+36,7
@@
class Image(dvcs_models.Document):
# Representing
# ============
# Representing
# ============
- def __
unicode
__(self):
+ def __
str
__(self):
return self.title
@models.permalink
return self.title
@models.permalink
@@
-81,11
+79,11
@@
class Image(dvcs_models.Document):
picture = WLPicture.from_bytes(
picture_xml.encode('utf-8'),
image_store=SelfImageStore)
picture = WLPicture.from_bytes(
picture_xml.encode('utf-8'),
image_store=SelfImageStore)
- except ParseError
,
e:
+ except ParseError
as
e:
raise AssertionError(_('Invalid XML') + ': ' + str(e))
except NoDublinCore:
raise AssertionError(_('No Dublin Core found.'))
raise AssertionError(_('Invalid XML') + ': ' + str(e))
except NoDublinCore:
raise AssertionError(_('No Dublin Core found.'))
- except ValidationError
,
e:
+ except ValidationError
as
e:
raise AssertionError(_('Invalid Dublin Core') + ': ' + str(e))
valid_about = self.correct_about()
raise AssertionError(_('Invalid Dublin Core') + ': ' + str(e))
valid_about = self.correct_about()
@@
-95,13
+93,13
@@
class Image(dvcs_models.Document):
def publishable_error(self):
try:
return self.assert_publishable()
def publishable_error(self):
try:
return self.assert_publishable()
- except AssertionError
,
e:
+ except AssertionError
as
e:
return e
else:
return None
def accessible(self, request):
return e
else:
return None
def accessible(self, request):
- return self.public or request.user.is_authenticated
()
+ return self.public or request.user.is_authenticated
def is_new_publishable(self):
change = self.publishable()
def is_new_publishable(self):
change = self.publishable()