def update(self, doctype, doc, migration_id): if doctype == 'Events': d = frappe.get_doc("Event", doc["name"]) if has_permission(d, self.account.name): if migration_id is not None: try: doctype = "Event" return self.update_events(doctype, doc, migration_id) except Exception: frappe.log_error(frappe.get_traceback(), "GCalendar Synchronization Error")
def insert(self, doctype, doc): if doctype == 'Events': d = frappe.get_doc("Event", doc["name"]) if has_permission(d, self.account.name): try: doctype = "Event" e = self.insert_events(doctype, doc) return e except Exception: frappe.log_error(frappe.get_traceback(), "GCalendar Synchronization Error")
def update(self, doctype, doc, migration_id): if doctype == 'Events': from frappe.desk.doctype.event.event import has_permission d = frappe.get_doc("Event", doc["name"]) if has_permission(d, self.account.name): if doc["start_datetime"] >= datetime.now() and migration_id is not None: try: doctype = "Event" return self.update_events(doctype, doc, migration_id) except Exception: frappe.log_error(frappe.get_traceback(), "GCalendar Synchronization Error")
def insert(self, doctype, doc): if doctype == 'Events': from frappe.desk.doctype.event.event import has_permission d = frappe.get_doc("Event", doc["name"]) if has_permission(d, self.account.name): if doc["start_datetime"] >= datetime.now(): try: doctype = "Event" e = self.insert_events(doctype, doc) return e except Exception: frappe.log_error(frappe.get_traceback(), "GCalendar Synchronization Error")