forked from nathanabay/bespo_notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_auth_errors.py
More file actions
23 lines (20 loc) · 753 Bytes
/
test_auth_errors.py
File metadata and controls
23 lines (20 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import frappe
def run():
frappe.init(site="erp.bespo.et", sites_path="/home/frappe/frappe-bench/sites")
frappe.connect()
logs = frappe.db.sql("""
SELECT name, method, LEFT(error, 1000)
FROM `tabError Log`
WHERE error LIKE '%login%' OR error LIKE '%auth%' OR method LIKE '%login%' OR method LIKE '%auth%' OR error LIKE '%trigger%'
ORDER BY creation DESC
LIMIT 10
""", as_dict=True)
if not logs:
print("No auth/login/trigger error logs found recently.")
else:
for log in logs:
print(f"--- {log.name} ---")
print(f"Method: {log.method}")
print(f"Error:\n{log.get('LEFT(error, 1000)')}\n")
if __name__ == "__main__":
run()