66
61
if pybb_settings.ATTACHMENT_ENABLE:
67
62
self.save_attachment(post, self.cleaned_data['attachment'])
78
66
def save_attachment(self, post, memfile):
80
68
obj = Attachment(size=memfile.size, content_type=memfile.content_type,
81
69
name=memfile.name, post=post)
84
73
path = os.path.join(dir, fname)
85
74
file(path, 'w').write(memfile.read())