1
0
mirror of https://github.com/moepman/bk-dss synced 2024-12-22 18:24: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')) 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): def __call__(self, *args, **kwargs):
kwargs.setdefault('readonly', True) kwargs.setdefault('readonly', True)
return super(ReadonlyStringField, self).__call__(*args, **kwargs) return super(ReadOnlyField, self).__call__(*args, **kwargs)
class CreateForm(Form): class CreateForm(Form):
user = StringField('Username', validators = [Required()]) user = StringField('Username', validators = [Required()])
@ -32,7 +32,7 @@ class CreateForm(Form):
submit = SubmitField('Submit') submit = SubmitField('Submit')
class EditForm(Form): class EditForm(Form):
user = ReadonlyStringField('Username') user = ReadOnlyField('Username')
pwd1 = PasswordField('New Password', validators = [Required()]) pwd1 = PasswordField('New Password', validators = [Required()])
pwd2 = PasswordField('New Password (repeat)', validators = [Required(), EqualTo('pwd1', "Passwords must match")]) pwd2 = PasswordField('New Password (repeat)', validators = [Required(), EqualTo('pwd1', "Passwords must match")])
submit = SubmitField('Submit') submit = SubmitField('Submit')