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

Make debug=true use the features config in openlibrary.yml #10014

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions conf/openlibrary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ http_request_timeout: 10

features:
cache_most_recent: enabled
debug: enabled
dev: enabled
history_v2: admin
inlibrary: enabled
Expand Down
5 changes: 2 additions & 3 deletions openlibrary/plugins/openlibrary/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
infogami.config.features = [] # type: ignore[attr-defined]

from infogami.utils.app import metapage
from infogami.utils import delegate
from infogami.utils import delegate, features
from openlibrary.utils import dateutil
from infogami.utils.view import (
render,
Expand Down Expand Up @@ -1127,7 +1127,6 @@ def save_error():


def internalerror():
i = web.input(_method='GET', debug='false')
name = save_error()

# TODO: move this stats stuff to plugins\openlibrary\stats.py
Expand All @@ -1141,7 +1140,7 @@ def internalerror():
if sentry.enabled:
sentry.capture_exception_webpy()

if i.debug.lower() == 'true':
if features.is_enabled('debug'):
raise web.debugerror()
else:
msg = render.site(render.internalerror(name))
Expand Down
4 changes: 2 additions & 2 deletions openlibrary/templates/admin/people/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h1><a class="plain" href="/admin/people">$_("People")</a> / $person.username</h
<div id="contentBody">

<div class="status status-$person.status">
<form method="POST" action="?debug=true">
<form method="POST">
Status: <span class="status">$person.status</span>

$if person.status in ['active', 'verified']:
Expand Down Expand Up @@ -216,7 +216,7 @@ <h1><a class="plain" href="/admin/people">$_("People")</a> / $person.username</h
<tr>
<td>$_("Anonymize Account:")</td>
<td>
<form method="POST" id="anonymize-form" action="?debug=true">
<form method="POST" id="anonymize-form">
<input type="checkbox" id="dry-run-checkbox" name="dry_run">
<label for="dry-run-checkbox">$_("Dry Run")</label>
<button type="submit" name="action" value="anonymize_account" style="float: right;" class="account-anonymization-button" data-display-name="$person.username">$_("Anonymize Account")</button>
Expand Down
2 changes: 1 addition & 1 deletion openlibrary/templates/type/list/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h1>$(_("Create a list") if new else _("Edit List"))</h1>
</div>

<div id="contentBody">
<form method="post" id="list-edit" class="olform" $:cond(query_param('debug'), 'action="?debug=true"')>
<form method="post" id="list-edit" class="olform">
$if not new:
<input
required
Expand Down
Loading