コード例 #1
0
ファイル: forms.py プロジェクト: t10r/ihatemoney
 def validate_id(form, field):
     form.id.data = slugify(field.data)
     if (form.id.data == "dashboard") or Project.query.get(form.id.data):
         message = _(
             "A project with this identifier (\"%(project)s\") already exists. "
             "Please choose a new identifier",
             project=form.id.data)
         raise ValidationError(Markup(message))
コード例 #2
0
ファイル: forms.py プロジェクト: s-boardman/ihatemoney
 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")
         raise ValidationError(Markup(message))
コード例 #3
0
ファイル: forms.py プロジェクト: Glandos/ihatemoney
 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")
         raise ValidationError(Markup(message))