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

fix(doctor): update broken command behaviour #10633

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions frappe/commands/__init__.py
Expand Up @@ -43,12 +43,14 @@ def _func(ctx, *args, **kwargs):

return click.pass_context(_func)

def get_site(context):
def get_site(context, raise_err=True):
try:
site = context.sites[0]
return site
except (IndexError, TypeError):
raise frappe.SiteNotSpecifiedError
if raise_err:
raise frappe.SiteNotSpecifiedError
return None

def popen(command, *args, **kwargs):
output = kwargs.get('output', True)
Expand Down
2 changes: 1 addition & 1 deletion frappe/commands/scheduler.py
Expand Up @@ -126,7 +126,7 @@ def doctor(context, site=None):
"Get diagnostic info about background workers"
from frappe.utils.doctor import doctor as _doctor
if not site:
site = get_site(context)
site = get_site(context, raise_err=False)
return _doctor(site=site)

@click.command('show-pending-jobs')
Expand Down