Skip to content

Commit 42cef8b

Browse files
author
Richard Jones
committed
set the content type on page templates (can have XML templates now)
1 parent 8b770b1 commit 42cef8b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Fixed:
1313
- applied CSV fix for python2.3 (sf bug 790363)
1414
- fixed form padding in LHS menu (sf bug 790502)
1515
- fixed upgrading docs for timezones (sf bug 790498)
16+
- set the content type on page templates (can have XML templates now)
1617

1718

1819
2003-08-08 0.6.0

roundup/cgi/templating.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import sys, cgi, urllib, os, re, os.path, time, errno
1+
import sys, cgi, urllib, os, re, os.path, time, errno, mimetypes
22

33
from roundup import hyperdb, date, rcsv
44
from roundup.i18n import _
@@ -116,7 +116,8 @@ def get(self, name, extension=None):
116116

117117
# compile the template
118118
self.templates[src] = pt = RoundupPageTemplate()
119-
pt.write(open(src).read())
119+
# use pt_edit so we can pass the content_type guess too
120+
pt.pt_edit(open(src).read(), mimetypes.guess_type(filename))
120121
pt.id = filename
121122
pt.mtime = time.time()
122123
return pt

0 commit comments

Comments
 (0)