Implement change password
This commit is contained in:
@@ -177,7 +177,7 @@ class SwitchUserForm(FlaskForm):
|
||||
@rank_required(UserRank.ADMIN)
|
||||
def switch_user():
|
||||
form = SwitchUserForm(formdata=request.form)
|
||||
if request.method == "POST" and form.validate():
|
||||
if form.validate_on_submit():
|
||||
user = User.query.filter_by(username=form["username"].data).first()
|
||||
if user is None:
|
||||
flash("Unable to find user", "danger")
|
||||
|
||||
@@ -48,7 +48,7 @@ def create_edit_license(name=None):
|
||||
form = LicenseForm(formdata=request.form, obj=license)
|
||||
if request.method == "GET" and license is None:
|
||||
form.is_foss.data = True
|
||||
elif request.method == "POST" and form.validate():
|
||||
elif form.validate_on_submit():
|
||||
if license is None:
|
||||
license = License(form.name.data)
|
||||
db.session.add(license)
|
||||
|
||||
@@ -60,7 +60,7 @@ def create_edit_tag(name=None):
|
||||
abort(403)
|
||||
|
||||
form = TagForm(formdata=request.form, obj=tag)
|
||||
if request.method == "POST" and form.validate():
|
||||
if form.validate_on_submit():
|
||||
if tag is None:
|
||||
tag = Tag(form.title.data)
|
||||
tag.description = form.description.data
|
||||
|
||||
@@ -46,7 +46,7 @@ def create_edit_version(name=None):
|
||||
abort(404)
|
||||
|
||||
form = VersionForm(formdata=request.form, obj=version)
|
||||
if request.method == "POST" and form.validate():
|
||||
if form.validate_on_submit():
|
||||
if version is None:
|
||||
version = MinetestRelease(form.name.data)
|
||||
db.session.add(version)
|
||||
|
||||
@@ -47,7 +47,7 @@ def create_edit_warning(name=None):
|
||||
abort(404)
|
||||
|
||||
form = WarningForm(formdata=request.form, obj=warning)
|
||||
if request.method == "POST" and form.validate():
|
||||
if form.validate_on_submit():
|
||||
if warning is None:
|
||||
warning = ContentWarning(form.title.data, form.description.data)
|
||||
db.session.add(warning)
|
||||
|
||||
Reference in New Issue
Block a user