Browse files

only return None in the transaction-mode case

  • Loading branch information...
1 parent 0277d46 commit aff51ffa8b963f0148d49c1c7e28b96ddab49914 @bukzor bukzor committed Apr 9, 2012
Showing with 6 additions and 8 deletions.
  1. +6 −8 cheetah/Compiler.py
View
14 cheetah/Compiler.py
@@ -1096,14 +1096,12 @@ def _addAutoCleanupCode(self):
self.addChunk('')
def addStop(self, expr=None):
- self.addChunk('if _dummyTrans:')
- self.indent()
- self.addChunk('return trans.response().getvalue()')
- self.dedent()
- self.addChunk('else:')
- self.indent()
- self.addChunk('return None')
- self.dedent()
+ if self.setting('autoAssignDummyTransactionToSelf'):
+ empty = None
+ else:
+ empty = ''
+
+ self.addChunk('return _dummyTrans and trans.response().getvalue() or %r' % empty)
def addMethArg(self, name, defVal=None):
self._argStringList.append( (name, defVal) )

0 comments on commit aff51ff

Please sign in to comment.