Commit 870477aa authored by Florent Guillaume's avatar Florent Guillaume

Check REQUEST in source_txt too. (Collector #1572)

Use proper if REQUEST is not None everywhere.
parent bd3b901b
...@@ -32,7 +32,7 @@ def manage_addZReST(self, id, file='', REQUEST=None): ...@@ -32,7 +32,7 @@ def manage_addZReST(self, id, file='', REQUEST=None):
# validate the instance_home # validate the instance_home
self._setObject(id, ZReST(id)) self._setObject(id, ZReST(id))
self._getOb(id).manage_upload(file) self._getOb(id).manage_upload(file)
if REQUEST: if REQUEST is not None:
return self.manage_main(self, REQUEST) return self.manage_main(self, REQUEST)
class Warnings: class Warnings:
...@@ -87,7 +87,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent): ...@@ -87,7 +87,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
def index_html(self, REQUEST=None): def index_html(self, REQUEST=None):
''' Getting the formatted text ''' Getting the formatted text
''' '''
if REQUEST: if REQUEST is not None:
REQUEST.RESPONSE.setHeader('content-type', 'text/html; charset=%s' % self.output_encoding) REQUEST.RESPONSE.setHeader('content-type', 'text/html; charset=%s' % self.output_encoding)
return self.formatted return self.formatted
...@@ -95,6 +95,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent): ...@@ -95,6 +95,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
def source_txt(self, REQUEST=None): def source_txt(self, REQUEST=None):
''' Getting the source text ''' Getting the source text
''' '''
if REQUEST is not None:
REQUEST.RESPONSE.setHeader('content-type', 'text/plain; charset=%s' % self.input_encoding) REQUEST.RESPONSE.setHeader('content-type', 'text/plain; charset=%s' % self.input_encoding)
return self.source return self.source
...@@ -114,7 +115,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent): ...@@ -114,7 +115,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
self.source = data self.source = data
self.render() self.render()
if REQUEST: if REQUEST is not None:
message="Saved changes." message="Saved changes."
return self.manage_main(self, REQUEST, manage_tabs_message=message) return self.manage_main(self, REQUEST, manage_tabs_message=message)
...@@ -166,7 +167,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent): ...@@ -166,7 +167,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
self.source = file.read() self.source = file.read()
self.render() self.render()
if REQUEST: if REQUEST is not None:
message="Saved changes." message="Saved changes."
return self.manage_main(self, REQUEST, manage_tabs_message=message) return self.manage_main(self, REQUEST, manage_tabs_message=message)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment