Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
870477aa
Commit
870477aa
authored
Nov 21, 2004
by
Florent Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check REQUEST in source_txt too. (Collector #1572)
Use proper if REQUEST is not None everywhere.
parent
bd3b901b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
lib/python/Products/ZReST/ZReST.py
lib/python/Products/ZReST/ZReST.py
+6
-5
No files found.
lib/python/Products/ZReST/ZReST.py
View file @
870477aa
...
...
@@ -32,7 +32,7 @@ def manage_addZReST(self, id, file='', REQUEST=None):
# validate the instance_home
self
.
_setObject
(
id
,
ZReST
(
id
))
self
.
_getOb
(
id
).
manage_upload
(
file
)
if
REQUEST
:
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
class
Warnings
:
...
...
@@ -87,7 +87,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
def
index_html
(
self
,
REQUEST
=
None
):
''' Getting the formatted text
'''
if
REQUEST
:
if
REQUEST
is
not
None
:
REQUEST
.
RESPONSE
.
setHeader
(
'content-type'
,
'text/html; charset=%s'
%
self
.
output_encoding
)
return
self
.
formatted
...
...
@@ -95,6 +95,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
def
source_txt
(
self
,
REQUEST
=
None
):
''' Getting the source text
'''
if
REQUEST
is
not
None
:
REQUEST
.
RESPONSE
.
setHeader
(
'content-type'
,
'text/plain; charset=%s'
%
self
.
input_encoding
)
return
self
.
source
...
...
@@ -114,7 +115,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
self
.
source
=
data
self
.
render
()
if
REQUEST
:
if
REQUEST
is
not
None
:
message
=
"Saved changes."
return
self
.
manage_main
(
self
,
REQUEST
,
manage_tabs_message
=
message
)
...
...
@@ -166,7 +167,7 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
self
.
source
=
file
.
read
()
self
.
render
()
if
REQUEST
:
if
REQUEST
is
not
None
:
message
=
"Saved changes."
return
self
.
manage_main
(
self
,
REQUEST
,
manage_tabs_message
=
message
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment