diff --git a/boards/models/attachment/__init__.py b/boards/models/attachment/__init__.py --- a/boards/models/attachment/__init__.py +++ b/boards/models/attachment/__init__.py @@ -53,11 +53,11 @@ class Attachment(models.Model): file_viewer = None for viewer in get_viewers(): if viewer.supports(self.mimetype): - file_viewer = viewer(self.file, self.mimetype) + file_viewer = viewer break if file_viewer is None: - file_viewer = AbstractViewer(self.file, self.mimetype) + file_viewer = AbstractViewer - return file_viewer.get_view() + return file_viewer(self.file, self.mimetype).get_view()