Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credentials: Convert confidentiality agreement config var to bool before comparison #13602

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions webapp/shop/cred/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from distutils.util import strtobool
from datetime import datetime, timedelta
import math
import pytz
Expand Down Expand Up @@ -195,6 +196,7 @@ def cred_your_exams(ua_contracts_api, trueability_api, **kwargs):
}
)
exam_contracts = []

exams_in_progress = []
exams_scheduled = []
exams_not_taken = []
Expand Down Expand Up @@ -403,9 +405,15 @@ def cred_assessments(trueability_api, **_):
@shop_decorator(area="cred", permission="user", response="html")
def cred_exam(trueability_api, **_):
email = flask.session["openid"]["email"].lower()
if os.getenv(
"CREDENTIALS_CONFIDENTIALITY_ENABLED"
) and not has_filed_confidentiality_agreement(email):

confidentiality_agreement_enabled = strtobool(
os.getenv("CREDENTIALS_CONFIDENTIALITY_ENABLED", "false")
)

if (
confidentiality_agreement_enabled
and not has_filed_confidentiality_agreement(email)
):
return flask.render_template("credentials/exam-no-agreement.html"), 403

assessment_id = flask.request.args.get("id")
Expand Down
Loading