Commits

Virgil Dupras committed 6ca320f

Fixed topic attachments under Python 3.

Forgot a call to file() in previous commit.

Comments (0)

Files changed (1)

djangobb_forum/views.py

 @login_required
 def show_attachment(request, hash):
     attachment = get_object_or_404(Attachment, hash=hash)
-    file_data = file(attachment.get_absolute_path(), 'rb').read()
+    file_data = open(attachment.get_absolute_path(), 'rb').read()
     response = HttpResponse(file_data, mimetype=attachment.content_type)
     response['Content-Disposition'] = 'attachment; filename="%s"' % smart_str(attachment.name)
     return response