##// END OF EJS Templates
Refactored attachment viewer getting method
neko259 -
r1306:f9fccc44 default
parent child Browse files
Show More
@@ -53,11 +53,11 b' class Attachment(models.Model):'
53 file_viewer = None
53 file_viewer = None
54 for viewer in get_viewers():
54 for viewer in get_viewers():
55 if viewer.supports(self.mimetype):
55 if viewer.supports(self.mimetype):
56 file_viewer = viewer(self.file, self.mimetype)
56 file_viewer = viewer
57 break
57 break
58 if file_viewer is None:
58 if file_viewer is None:
59 file_viewer = AbstractViewer(self.file, self.mimetype)
59 file_viewer = AbstractViewer
60
60
61 return file_viewer.get_view()
61 return file_viewer(self.file, self.mimetype).get_view()
62
62
63
63
General Comments 0
You need to be logged in to leave comments. Login now