1
0
mirror of https://github.com/moepman/bk-dss synced 2024-12-22 08:04:27 +01:00

Rename ReadOnlyStringField to ReadOnlyField.

This commit is contained in:
Markus 2016-04-16 21:02:08 +02:00
parent a01d33d989
commit 5aabd7ed6d

View File

@ -17,10 +17,10 @@ app.jinja_env.lstrip_blocks = True
rdb = Redis(host=app.config.get('REDIS_HOST', '127.0.0.1'), password=app.config.get('REDIS_PSWD'))
class ReadonlyStringField(StringField):
class ReadOnlyField(StringField):
def __call__(self, *args, **kwargs):
kwargs.setdefault('readonly', True)
return super(ReadonlyStringField, self).__call__(*args, **kwargs)
return super(ReadOnlyField, self).__call__(*args, **kwargs)
class CreateForm(Form):
user = StringField('Username', validators = [Required()])
@ -32,7 +32,7 @@ class CreateForm(Form):
submit = SubmitField('Submit')
class EditForm(Form):
user = ReadonlyStringField('Username')
user = ReadOnlyField('Username')
pwd1 = PasswordField('New Password', validators = [Required()])
pwd2 = PasswordField('New Password (repeat)', validators = [Required(), EqualTo('pwd1', "Passwords must match")])
submit = SubmitField('Submit')