summaryrefslogtreecommitdiff
path: root/controller.py
diff options
context:
space:
mode:
Diffstat (limited to 'controller.py')
-rw-r--r--controller.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/controller.py b/controller.py
index 55baa09..824c638 100644
--- a/controller.py
+++ b/controller.py
@@ -309,7 +309,15 @@ class ConstEdit (ConstAdd):
def POST(self, id):
exp = ConstExpense.get(id)
self.get_expense = lambda *x: exp
- return ConstAdd.POST(self)
+
+ if "changeB" in web.input():
+ return ConstAdd.POST(self)
+ elif "deleteB" in web.input():
+ web.ctx.orm.delete(exp)
+ raise web.seeother("/const")
+ else:
+ return self.GET(id)
+
class Cat:
def GET(self):