Commits

Anonymous committed eee509d

Fixed error

  • Participants
  • Parent commits 2430038

Comments (0)

Files changed (1)

smallpress/controllers/root.py

 from tgext.tagging.controllers import TaggingController
 from tgext.crud import EasyCrudRestController
 
+AttachmentType = config.get('_smallpress',{}).get('attachment_type', AttachedFile)
+
 try:
     import whoosh
     from whoosh.query import *
     def attach(self, **kw):
         article = DBSession.query(Article).get(kw['article'])
         attachment = Attachment(name=kw['name'], article=article,
-                                content=AttachedFile(kw['file'].file, kw['file'].filename))
+                                content=AttachmentType(kw['file'].file, kw['file'].filename))
         DBSession.add(attachment)
         DBSession.flush()