From 0e40b18ecc539ea73e96d2ab45cc40eb835952de Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 31 Jul 2018 18:27:05 +0530 Subject: [PATCH] Allow guest connection in FrappeClient --- .../doctype/data_migration_run/data_migration_run.py | 1 - frappe/frappeclient.py | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frappe/data_migration/doctype/data_migration_run/data_migration_run.py b/frappe/data_migration/doctype/data_migration_run/data_migration_run.py index a38699f01f..cd446d2a56 100644 --- a/frappe/data_migration/doctype/data_migration_run/data_migration_run.py +++ b/frappe/data_migration/doctype/data_migration_run/data_migration_run.py @@ -138,7 +138,6 @@ class DataMigrationRun(Document): if postprocess_method_path: frappe.get_attr(postprocess_method_path)({ "status": status, - "remote_id": self.remote_id or '', "stats": { "push_insert": self.push_insert, "push_update": self.push_update, diff --git a/frappe/frappeclient.py b/frappe/frappeclient.py index e323ffb7c6..7d12267681 100644 --- a/frappe/frappeclient.py +++ b/frappe/frappeclient.py @@ -15,12 +15,15 @@ class FrappeException(Exception): pass class FrappeClient(object): - def __init__(self, url, username, password, verify=True): + def __init__(self, url, username=None, password=None, verify=True): self.headers = dict(Accept='application/json') self.verify = verify self.session = requests.session() self.url = url - self._login(username, password) + + # for guest connection + if username: + self._login(username, password) def __enter__(self): return self