8000 v15: Workspace: UnboundLocalError: local variable 'doc' referenced before assignment · Issue #23555 · frappe/frappe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
v15: Workspace: UnboundLocalError: local variable 'doc' referenced before assignment #23555
Closed
@casesolved-co-uk

Description

@casesolved-co-uk

doc not necessarily initialised if title doesn't equal label

	filters = {"public": public, "label": title}

	if not public:
		filters = {"for_user": frappe.session.user, "label": title + "-" + frappe.session.user}
	pages = frappe.get_all("Workspace", filters=filters)
	if pages:
		doc = frappe.get_doc("Workspace", pages[0])

request.js:473 Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 110, in application
response = frappe.api.handle(request)
File "apps/frappe/frappe/api/init.py", line 49, in handle
data = endpoint(**arguments)
File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 49, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1689, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
File "apps/frappe/frappe/desk/doctype/workspace/workspace.py", line 279, in save_page
doc.content = blocks
UnboundLocalError: local variable 'doc' referenced before assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0