• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

scoringengine / scoringengine / 23385248069

21 Mar 2026 05:50PM UTC coverage: 73.202% (-2.5%) from 75.69%
23385248069

push

github

RustyBower
Fix test to match DB fallback behavior for missing output files

The endpoint now returns check.output from DB (200) instead of 404
when the on-disk file doesn't exist.

3726 of 5090 relevant lines covered (73.2%)

0.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

29.63
/scoring_engine/web/views/api/profile.py
1
import html
1✔
2

3
from flask import flash, redirect, request, url_for
1✔
4
from flask_login import current_user, login_required
1✔
5

6
from scoring_engine.db import db
1✔
7

8
from . import mod
1✔
9

10

11
@mod.route("/api/profile/update_password", methods=["POST"])
1✔
12
@login_required
1✔
13
def profile_update_password():
1✔
14
    if (
×
15
        "user_id" in request.form
16
        and "currentpassword" in request.form
17
        and "password" in request.form
18
        and "confirmedpassword" in request.form
19
    ):
20
        # Ensure old password is correct
21
        if not current_user.check_password(request.form["currentpassword"]):
×
22
            flash("Invalid Password.", "danger")
×
23
            return redirect(url_for("profile.home"))
×
24
        # Ensure new password is not too long for bcrypt
25
        if len(request.form["password"].encode("utf-8")) > 72:
×
26
            flash("Password must be 72 bytes or fewer.", "danger")
×
27
            return redirect(url_for("profile.home"))
×
28
        # Ensure new passwords match
29
        if request.form["password"] != request.form["confirmedpassword"]:
×
30
            flash("Passwords do not match.", "danger")
×
31
            return redirect(url_for("profile.home"))
×
32
        if str(current_user.id) == request.form["user_id"]:
×
33
            current_user.update_password(html.escape(request.form["password"]))
×
34
            current_user.authenticated = False
×
35
            db.session.add(current_user)
×
36
            db.session.commit()
×
37
            flash("Password Successfully Updated.", "success")
×
38
            return redirect(url_for("profile.home"))
×
39
        else:
40
            return {"status": "Unauthorized"}, 403
×
41
    else:
42
        return {"status": "Unauthorized"}, 403
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc