aboutsummaryrefslogtreecommitdiff
path: root/budget/forms.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-10-08 13:22:18 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-10-08 13:27:30 +0200
commit48bc551853b8b0067cdaeef98b3e454c3249f98f (patch)
tree75332a6548aba9d95e0771de2af0e9e19d53efbc /budget/forms.py
parent402dbce153639668d47db00fdc7a0479d9ebc3f6 (diff)
downloadihatemoney-mirror-48bc551853b8b0067cdaeef98b3e454c3249f98f.zip
ihatemoney-mirror-48bc551853b8b0067cdaeef98b3e454c3249f98f.tar.gz
ihatemoney-mirror-48bc551853b8b0067cdaeef98b3e454c3249f98f.tar.bz2
Complete the REST API + Tests. Fix #27
Diffstat (limited to 'budget/forms.py')
-rw-r--r--budget/forms.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/budget/forms.py b/budget/forms.py
index 16fa0d6..25731bc 100644
--- a/budget/forms.py
+++ b/budget/forms.py
@@ -95,12 +95,13 @@ class BillForm(Form):
validators=[Required()], widget=select_multi_checkbox)
submit = SubmitField("Send the bill")
- def save(self, bill):
+ def save(self, bill, project):
bill.payer_id=self.payer.data
bill.amount=self.amount.data
bill.what=self.what.data
bill.date=self.date.data
- bill.owers = [Person.query.get(ower) for ower in self.payed_for.data]
+ bill.owers = [Person.query.get(ower, project)
+ for ower in self.payed_for.data]
return bill