MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / admin_device_approve

Function admin_device_approve

Scripts/ButSystem.py:12071–12097  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12069 flash("Invalid credentials.")
12070 return render_template("recover.html", title="Recover")
12071
12072 conn = db_connect()
12073 conn.execute("UPDATE users SET pw_hash=? WHERE username=?", (generate_password_hash(new_pw), username))
12074 conn.commit()
12075 conn.close()
12076 flash("Password changed.")
12077 return redirect(url_for("login"))
12078
12079@app.route("/profile/pic/upload", methods=["POST"])
12080@login_required
12081def profile_pic_upload():
12082 """profile_pic_upload.
12083
12084Route handler or application helper.
12085
12086This docstring was expanded to make future maintenance easier.
12087
12088Returns:
12089 Varies.
12090"""
12091 f = request.files.get("pic")
12092 if not f or not f.filename:
12093 flash("No picture selected.")
12094 return redirect(url_for("profile"))
12095 try:
12096 mime = _validate_profile_pic_upload(f)
12097 except ValueError:
12098 flash("Only images allowed.")
12099 return redirect(url_for("profile"))
12100 try:

Callers

nothing calls this directly

Calls 4

require_adminFunction · 0.70
current_userFunction · 0.70
db_connectFunction · 0.70
now_zFunction · 0.70

Tested by

no test coverage detected