aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/web.py
diff options
context:
space:
mode:
authorGlandos <bugs-github@antipoul.fr>2020-05-07 22:56:17 +0200
committerGitHub <noreply@github.com>2020-05-07 22:56:17 +0200
commit981edd413acfdd4786faf5439d2a05d6d7e4649e (patch)
tree3c1598baf52dd447fd806a5038e8b8f0c0e83fbc /ihatemoney/web.py
parent76911983af9e04e379853ab3c66804e73f5f16a0 (diff)
downloadihatemoney-mirror-981edd413acfdd4786faf5439d2a05d6d7e4649e.zip
ihatemoney-mirror-981edd413acfdd4786faf5439d2a05d6d7e4649e.tar.gz
ihatemoney-mirror-981edd413acfdd4786faf5439d2a05d6d7e4649e.tar.bz2
Improve currencies (#604)
- Rename "No Currency" to ISO4217 "XXX" - Use Babel to render currency symbols and names in currency lists - Improve i18n in bill lists Fix #601 Fix #600
Diffstat (limited to 'ihatemoney/web.py')
-rw-r--r--ihatemoney/web.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/ihatemoney/web.py b/ihatemoney/web.py
index bbc98c4..ae124ac 100644
--- a/ihatemoney/web.py
+++ b/ihatemoney/web.py
@@ -41,6 +41,7 @@ from ihatemoney.currency_convertor import CurrencyConverter
from ihatemoney.forms import (
AdminAuthenticationForm,
AuthenticationForm,
+ EditProjectForm,
InviteForm,
MemberForm,
PasswordReminder,
@@ -48,7 +49,6 @@ from ihatemoney.forms import (
ResetPasswordForm,
UploadForm,
get_billform_for,
- get_editprojectform_for,
)
from ihatemoney.history import get_history, get_history_queries
from ihatemoney.models import Bill, LoggingMode, Person, Project, db
@@ -377,7 +377,7 @@ def reset_password():
@main.route("/<project_id>/edit", methods=["GET", "POST"])
def edit_project():
- edit_form = get_editprojectform_for(g.project)
+ edit_form = EditProjectForm()
import_form = UploadForm()
# Import form
if import_form.validate_on_submit():
@@ -393,10 +393,10 @@ def edit_project():
if edit_form.validate_on_submit():
project = edit_form.update(g.project)
# Update converted currency
- if project.default_currency != CurrencyConverter.default:
+ if project.default_currency != CurrencyConverter.no_currency:
for bill in project.get_bills():
- if bill.original_currency == CurrencyConverter.default:
+ if bill.original_currency == CurrencyConverter.no_currency:
bill.original_currency = project.default_currency
bill.converted_amount = CurrencyConverter().exchange_currency(
@@ -417,6 +417,7 @@ def edit_project():
edit_form.ip_recording.data = True
edit_form.contact_email.data = g.project.contact_email
+ edit_form.default_currency.data = g.project.default_currency
return render_template(
"edit_project.html",
@@ -732,7 +733,7 @@ def edit_bill(bill_id):
return redirect(url_for(".list_bills"))
if not form.errors:
- form.fill(bill)
+ form.fill(bill, g.project)
return render_template("add_bill.html", form=form, edit=True)