Change the spam threshold to an integer, related to #103

This commit is contained in:
Pierre Jaury
2016-11-08 20:33:01 +01:00
parent afbcb9b8c6
commit a9cb1e2d11
3 changed files with 37 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ class User(Base, Email):
# Settings
displayed_name = db.Column(db.String(160), nullable=False, default="")
spam_enabled = db.Column(db.Boolean(), nullable=False, default=True)
spam_threshold = db.Column(db.Numeric(), nullable=False, default=80.0)
spam_threshold = db.Column(db.Integer(), nullable=False, default=80.0)
# Flask-login attributes
is_authenticated = True

View File

@@ -14,7 +14,7 @@ User settings
{{ macros.form_field(form.displayed_name) }}
{{ macros.form_field(form.spam_enabled) }}
{{ macros.form_field(form.spam_threshold, step=1, max=100,
prepend='<span class="input-group-addon"><span id="threshold">'+(form.spam_threshold.data).__int__().__str__()+'</span>&nbsp;/&nbsp;100</span>',
prepend='<span class="input-group-addon"><span id="threshold">'+form.spam_threshold.data.__str__()+'</span>&nbsp;/&nbsp;100</span>',
oninput='$("#threshold").text(this.value);') }}
{{ macros.form_field(form.submit) }}
</form>