mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 17:32:38 +02:00
Fixed billtype displaying in all caps
This commit is contained in:
parent
bf9601377d
commit
49286448ec
3 changed files with 8 additions and 3 deletions
|
@ -364,7 +364,7 @@ class BillForm(FlaskForm):
|
|||
payed_for = SelectMultipleField(
|
||||
_("For whom?"), validators=[DataRequired()], coerce=int
|
||||
)
|
||||
bill_type = SelectField(_("Bill Type"), validators=[DataRequired()], choices=BillType.choices())
|
||||
bill_type = SelectField(_("Bill Type"), validators=[DataRequired()], choices=BillType.choices(), coerce=BillType)
|
||||
submit = SubmitField(_("Submit"))
|
||||
submit2 = SubmitField(_("Submit and add a new one"))
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from collections import defaultdict
|
||||
from enum import Enum
|
||||
import datetime
|
||||
import itertools
|
||||
|
||||
|
@ -50,11 +51,15 @@ make_versioned(
|
|||
],
|
||||
)
|
||||
|
||||
class BillType(FormEnum):
|
||||
class BillType(Enum):
|
||||
EXPENSE = "Expense"
|
||||
REIMBURSEMENT = "Reimbursement"
|
||||
TRANSFER = "Transfer"
|
||||
|
||||
@classmethod
|
||||
def choices(cls):
|
||||
return [(choice, choice.value) for choice in cls]
|
||||
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@
|
|||
{{ bill.date }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ bill.bill_type }}</td>
|
||||
<td>{{ bill.bill_type.value }}</td>
|
||||
<td>{{ bill.payer }}</td>
|
||||
<td>{{ bill.what }}</td>
|
||||
<td>{% if bill.owers|length == g.project.members|length -%}
|
||||
|
|
Loading…
Reference in a new issue