projects
/
cascardo
/
ipsilon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use transactions throughout the code
[cascardo/ipsilon.git]
/
ipsilon
/
providers
/
common.py
diff --git
a/ipsilon/providers/common.py
b/ipsilon/providers/common.py
index
6bcfef8
..
b1968f4
100755
(executable)
--- a/
ipsilon/providers/common.py
+++ b/
ipsilon/providers/common.py
@@
-118,7
+118,13
@@
class ProviderPageBase(Page):
raise cherrypy.HTTPError(501)
def root(self, *args, **kwargs):
raise cherrypy.HTTPError(501)
def root(self, *args, **kwargs):
- op = getattr(self, cherrypy.request.method, self.GET)
+ method = cherrypy.request.method
+
+ preop = getattr(self, 'pre_%s' % method, None)
+ if preop and callable(preop):
+ preop(*args, **kwargs)
+
+ op = getattr(self, method, self.GET)
if callable(op):
return op(*args, **kwargs)
else:
if callable(op):
return op(*args, **kwargs)
else: