Skip to content
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
22 changes: 13 additions & 9 deletions profiles/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def user(uid=None, info=None):
# ldap_get_member() returns a BadQueryError if getting the user's information fails.
# Flask already treats a stray BadQueryError as a 404, but actually handling it prevents the traceback
# from getting dumped into the log.
return render_template("404.html", message=bqe, *app.config['DATADOG_RUM_CONFIG']), 404
return render_template("404.html", message=bqe, **app.config['DATADOG_RUM_CONFIG']), 404


@app.route("/results", methods=["POST"])
Expand All @@ -121,7 +121,7 @@ def search(searched=None, info=None):
return redirect("/user/" + members[0].uid, 302)
return render_template(
"listing.html", info=info, title="Search Results: " + searched,
members=members, *app.config['DATADOG_RUM_CONFIG']
members=members, **app.config['DATADOG_RUM_CONFIG']
)


Expand All @@ -134,25 +134,29 @@ def group(_group=None, info=None):
if _group == "eboard":
return render_template(
"listing.html", info=info, title=group_desc,
members=ldap_get_eboard(), *app.config['DATADOG_RUM_CONFIG']
members=ldap_get_eboard(), **app.config['DATADOG_RUM_CONFIG']
)

return render_template(
"listing.html",
info=info,
title=group_desc,
members=_ldap_get_group_members(_group),
*app.config['DATADOG_RUM_CONFIG']
**app.config['DATADOG_RUM_CONFIG']
)


@app.route("/year/<_year>", methods=["GET"])
@auth.oidc_auth("default")
@before_request
def year(_year=None, info=None):
print(_year)
return render_template(
"listing.html", info=info, title="Year: " + _year,
members=ldap_get_year(_year), *app.config['DATADOG_RUM_CONFIG']
"listing.html",
info=info,
title="Year: " + _year,
members=ldap_get_year(_year),
**app.config['DATADOG_RUM_CONFIG']
)


Expand Down Expand Up @@ -189,7 +193,7 @@ def image(uid):
try:
return get_image(uid)
except BadQueryError as bqe:
return render_template("404.html", message=bqe, *app.config['DATADOG_RUM_CONFIG']), 404
return render_template("404.html", message=bqe, **app.config['DATADOG_RUM_CONFIG']), 404


@app.route("/clearcache")
Expand Down Expand Up @@ -222,9 +226,9 @@ def clear_cache(info=None):
@app.errorhandler(500)
def handle_internal_error(e):
if isinstance(e, NotFound):
return render_template("404.html", message=str(e), *app.config['DATADOG_RUM_CONFIG']), 404
return render_template("404.html", message=str(e), **app.config['DATADOG_RUM_CONFIG']), 404
if isinstance(e.original_exception, BadQueryError):
return render_template("404.html", message=e.original_exception, *app.config['DATADOG_RUM_CONFIG']), 404
return render_template("404.html", message=e.original_exception, **app.config['DATADOG_RUM_CONFIG']), 404
raise e.original_exception


Expand Down
Loading