mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
Automatically select all members of the 'payed for' field when adding a bill.
This commit is contained in:
parent
7ee2e74969
commit
af2ca220a7
1 changed files with 6 additions and 1 deletions
|
@ -6,9 +6,14 @@ from forms import BillForm
|
|||
|
||||
def get_billform_for(project):
|
||||
"""Return an instance of BillForm configured for a particular project."""
|
||||
payers = []
|
||||
ids = []
|
||||
for m in project.active_members:
|
||||
payers.append( (str(m.id), m.name) )
|
||||
ids.append( str(m.id) )
|
||||
form = BillForm()
|
||||
payers = [(str(m.id), m.name) for m in project.active_members]
|
||||
form.payed_for.choices = form.payer.choices = payers
|
||||
form.payed_for.data = ids
|
||||
return form
|
||||
|
||||
def requires_auth(f):
|
||||
|
|
Loading…
Reference in a new issue