diff --git a/foundation/erpnext_foundation/doctype/chapter/chapter.py b/foundation/erpnext_foundation/doctype/chapter/chapter.py index b69b6c6e..f0d2bc57 100644 --- a/foundation/erpnext_foundation/doctype/chapter/chapter.py +++ b/foundation/erpnext_foundation/doctype/chapter/chapter.py @@ -39,8 +39,6 @@ def get_list_context(context): def leave(title, user_id, leave_reason): chapter = frappe.get_doc("Chapter", title) for member in chapter.members: - for x in xrange(1,10): - print(member.user, user_id) if member.user == user_id: member.enabled = 0 member.leave_reason = leave_reason diff --git a/foundation/www/leave-chapter.html b/foundation/www/leave-chapter.html index 4310831a..9b92221e 100644 --- a/foundation/www/leave-chapter.html +++ b/foundation/www/leave-chapter.html @@ -1,10 +1,4 @@ {% extends "templates/web.html" %} - {% block page_content %} {% if member_deleted %} @@ -29,7 +23,6 @@ var leave = $("#leave").val(); var user_id = frappe.session.user; var title = $(this).attr("data-title"); - console.log(leave, user_id, title); frappe.call({ method: 'foundation.erpnext_foundation.doctype.chapter.chapter.leave', args: { diff --git a/foundation/www/leave_chapter.py b/foundation/www/leave_chapter.py index 1ee366f8..da2d819e 100644 --- a/foundation/www/leave_chapter.py +++ b/foundation/www/leave_chapter.py @@ -3,15 +3,5 @@ import frappe def get_context(context): context.no_cache = True chapter = frappe.get_doc('Chapter', frappe.form_dict.name) - # if frappe.session.user!='Guest': - if frappe.session.user in [d.user for d in chapter.members]: - user = frappe.session.user - parent = frappe.form_dict.name - # leave_reason = frappe.form_dict.leave - # frappe.db.sql("""UPDATE `tabChapter Member` SET enabled = 0, leave_reason = %s WHERE parent = %s and user = %s ;""", (leave_reason, parent, user)) - # frappe.db.commit() - - context.member_deleted = True - context.chapter = chapter