Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 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))
Exemplo n.º 3
0
 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))