Fix formatting

This commit is contained in:
Nikos Epping 2021-11-21 16:22:07 +01:00
parent 71de84bc14
commit 775ab27531
No known key found for this signature in database
GPG key ID: 8AAF07BFD862BFBC
2 changed files with 18 additions and 3 deletions

View file

@ -11,7 +11,13 @@ from markupsafe import Markup
from werkzeug.security import check_password_hash, generate_password_hash
from wtforms.fields.core import Label, SelectField, SelectMultipleField
from wtforms.fields.html5 import DateField, DecimalField, URLField
from wtforms.fields.simple import BooleanField, PasswordField, StringField, SubmitField, HiddenField
from wtforms.fields.simple import (
BooleanField,
HiddenField,
PasswordField,
StringField,
SubmitField,
)
from wtforms.validators import (
URL,
DataRequired,
@ -326,7 +332,7 @@ class BillForm(FlaskForm):
bill.payer_id = self.payer.data
bill.amount = self.amount.data
bill.what = self.what.data
tag = list(set(part[1:] for part in bill.what.split() if part.startswith('#')))
tag = list(set(part[1:] for part in bill.what.split() if part.startswith("#")))
if tag:
bill.tag = tag[0]
bill.external_link = self.external_link.data

View file

@ -462,7 +462,16 @@ def import_project(file, project):
json_file = json.load(file)
# Check if JSON is correct
attr = ["what", "tag", "payer_name", "payer_weight", "amount", "currency", "date", "owers"]
attr = [
"what",
"tag",
"payer_name",
"payer_weight",
"amount",
"currency",
"date",
"owers",
]
attr.sort()
currencies = set()
for e in json_file: