Urgent help please

please iv puted a java script into website settings fro online chat for website but after that i cant access the desk

could you please help me in that ??

how can i remove that script from terminal or from the database ???

Use the bench console

bench --site site_name console

Then use the frappe python api to remove the Website Script

frappe.delete_doc('Website Script', 'name_of_script')

this is the script no name for it


i`v putted directly into header and footer html in website settings

In [1]: frappe.delete_doc(‘Website Script’, ‘Tawk.to’)

ProgrammingError Traceback (most recent call last)
/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.pyc in ()
----> 1 frappe.delete_doc(‘Website Script’, ‘Tawk.to’)

/home/frappe/frappe-bench/apps/frappe/frappe/init.pyc in delete_doc(doctype, name, force, ignore_doctypes, for_reload, ignore_permissions, flags)
639 import frappe.model.delete_doc
640 frappe.model.delete_doc.delete_doc(doctype, name, force, ignore_ doctypes, for_reload,
→ 641 ignore_permissions, flags)
643 def delete_doc_if_exists(doctype, name, force=0):

/home/frappe/frappe-bench/apps/frappe/frappe/model/delete_doc.pyc in delete_doc( doctype, name, force, ignore_doctypes, for_reload, ignore_permissions, flags, ig nore_on_trash)
85 update_naming_series(doc)
—> 86 delete_from_table(doctype, name, ignore_doctypes , doc)
87 doc.run_method(“after_delete”)

/home/frappe/frappe-bench/apps/frappe/frappe/model/delete_doc.pyc in delete_from _table(doctype, name, ignore_doctypes, doc)
128 frappe.db.sql("delete from tabSingles where doctype=%s ", name)
129 else:
→ 130 frappe.db.sql(“delete from tab%s where name=%s” % (fra ppe.db.escape(doctype), “%s”), (name,))
132 # get child tables

/home/frappe/frappe-bench/apps/frappe/frappe/database.pyc in sql(self, query, va lues, as_dict, as_list, formatted, debug, ignore_ddl, as_utf8, auto_commit, upda te)
136 frappe.log(values)
137 frappe.log(“>>>>”)
→ 138 self._cursor.execute(query, values)
140 else:

/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors. pyc in execute(self, query, args)
248 except Exception:
249 exc, value = sys.exc_info()[:2]
→ 250 self.errorhandler(self, exc, value)
251 self._executed = query
252 if not self._defer_warnings:

/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connecti ons.pyc in defaulterrorhandler(failed resolving arguments)
40 del connection
41 if isinstance(errorvalue, BaseException):
—> 42 raise errorvalue
43 if errorclass is not None:
44 raise errorclass(errorvalue)

ProgrammingError: (1146, “Table ‘1bd3e0294da19198.tabWebsite Script’ doesn’t exi st”)

i`v resolved it by updating the value of head_html field in tabSingles and its working fine now