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

Add decoding for params from url #376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions rq_dashboard/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def setup_rq_connection():
redis_url = current_app.config.get("RQ_DASHBOARD_REDIS_URL")
if isinstance(redis_url, string_types):
current_app.config["RQ_DASHBOARD_REDIS_URL"] = (redis_url,)
_, current_app.redis_conn = from_url((redis_url,)[0])
_, current_app.redis_conn = from_url((redis_url,)[0], client_options = dict(decode_components=True))
elif isinstance(redis_url, (tuple, list)):
_, current_app.redis_conn = from_url(redis_url[0])
_, current_app.redis_conn = from_url(redis_url[0], client_options = dict(decode_components=True))
else:
raise RuntimeError("No Redis configuration!")

Expand All @@ -79,7 +79,7 @@ def push_rq_connection():
if new_instance_number is not None:
redis_url = current_app.config.get("RQ_DASHBOARD_REDIS_URL")
if new_instance_number < len(redis_url):
_, new_instance = from_url(redis_url[new_instance_number])
_, new_instance = from_url(redis_url[new_instance_number], client_options = dict(decode_components=True))
else:
raise LookupError("Index exceeds RQ list. Not Permitted.")
else:
Expand Down