Django update.
[redakcja.git] / src / catalogue / models / image.py
index 34f61f9..dbe1c04 100755 (executable)
@@ -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.
 #
@@ -38,7 +36,7 @@ class Image(dvcs_models.Document):
     # Representing
     # ============
 
-    def __unicode__(self):
+    def __str__(self):
         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)
-        except ParseError, e:
+        except ParseError as e:
             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()
@@ -95,13 +93,13 @@ class Image(dvcs_models.Document):
     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 self.public or request.user.is_authenticated()
+        return self.public or request.user.is_authenticated
 
     def is_new_publishable(self):
         change = self.publishable()