From 669b15b0ec0a491f169772ac69e96a9970759a36 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Fri, 26 Jul 2019 15:54:50 +0200 Subject: Improve already project exists message --- ihatemoney/forms.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'ihatemoney/forms.py') diff --git a/ihatemoney/forms.py b/ihatemoney/forms.py index be04c8f..67f4ec1 100644 --- a/ihatemoney/forms.py +++ b/ihatemoney/forms.py @@ -54,8 +54,8 @@ class CalculatorStringField(StringField): def process_formdata(self, valuelist): if valuelist: message = _( - "Not a valid amount or expression." - "Only numbers and + - * / operators" + "Not a valid amount or expression. " + "Only numbers and + - * / operators " "are accepted." ) value = str(valuelist[0]).replace(",", ".") @@ -101,12 +101,8 @@ class ProjectForm(EditProjectForm): def validate_id(form, field): form.id.data = slugify(field.data) if (form.id.data == "dashboard") or Project.query.get(form.id.data): - message = _("The project identifier is used to log in and for the " - "URL of the project. " - "We tried to generate an identifier for you but a " - "project with this identifier already exists. " - "Please create a new identifier that you will be able " - "to remember") + message = _("A project with this identifier (\"%(project)s\") already exists. " + "Please choose a new identifier", project=form.id.data) raise ValidationError(Markup(message)) -- cgit v1.1