comparison MoinMoin/action/AttachFile.py @ 1904:82667e81b928

Fix crash in AttachFile when called by xmlrpc and request.page is None
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 22 Mar 2007 07:23:36 +0100
parents 76040d9ab344
children 5c3dffe2abf1
comparison
equal deleted inserted replaced
1903:0a6764ab0c16 1904:82667e81b928
63 attach_dir = os.path.join(request.cfg.attachments['dir'], pagename, "attachments") 63 attach_dir = os.path.join(request.cfg.attachments['dir'], pagename, "attachments")
64 if create and not os.path.isdir(attach_dir): 64 if create and not os.path.isdir(attach_dir):
65 os.makedirs(attach_dir) 65 os.makedirs(attach_dir)
66 else: 66 else:
67 # send file via CGI, from page storage area 67 # send file via CGI, from page storage area
68 if pagename == request.page.page_name: 68 if request.page and pagename == request.page.page_name:
69 page = request.page # reusing existing page obj is faster 69 page = request.page # reusing existing page obj is faster
70 else: 70 else:
71 page = Page(request, pagename) 71 page = Page(request, pagename)
72 attach_dir = page.getPagePath("attachments", check_create=create) 72 attach_dir = page.getPagePath("attachments", check_create=create)
73 73