Merge branch 'develop' into fix-control_rating-test-ci-fail

This commit is contained in:
mergify[bot] 2026-02-24 09:15:01 +00:00 committed by GitHub
commit 395163c5f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 14 deletions

View file

@ -23,7 +23,7 @@
"default": "1",
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled System Notification"
"label": "Enable System Notification"
},
{
"fieldname": "subscribed_documents",
@ -98,7 +98,7 @@
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2026-02-17 13:39:35.159083",
"modified": "2026-02-24 11:06:24.112935",
"modified_by": "Administrator",
"module": "Desk",
"name": "Notification Settings",

View file

@ -265,6 +265,10 @@ def run_doc_method(method, docs=None, dt=None, dn=None, arg=None, args=None):
if dt: # not called from a doctype (from a page)
if not dn:
dn = dt # single
if not isinstance(dn, str | int):
frappe.throw("'dn' must be a string or an integer")
doc = frappe.get_doc(dt, dn, check_permission=True)
else:

View file

@ -239,17 +239,22 @@ def remove_orphan_entities():
all_enitities = frappe.get_all(
app_entity, filters=entity_filter_map.get(app_entity), fields=["name", "app"]
)
for i, w in enumerate(all_enitities):
if w.app and not check_if_record_exists("app", frappe.get_app_path(w.app), app_entity, w.name):
try:
print(f"Deleting entity {app_entity} {w.name}")
frappe.delete_doc(app_entity, w.name, force=True, ignore_missing=True)
update_progress_bar(f"Deleting orphaned {app_entity}", i, len(all_enitities))
print()
except Exception as e:
print(f"Error occurred while deleting entity: {app_entity} {w.name}")
print(e)
for i, entity in enumerate(all_enitities):
try:
app_path = frappe.get_app_path(entity.app)
if entity.app and not check_if_record_exists("app", app_path, app_entity, entity.name):
try:
print(f"Deleting entity {app_entity} {entity.name}")
frappe.delete_doc(app_entity, entity.name, force=True, ignore_missing=True)
update_progress_bar(f"Deleting orphaned {app_entity}", i, len(all_enitities))
print()
except Exception as e:
print(f"Error occurred while deleting entity: {app_entity} {entity.name}")
print(e)
except ModuleNotFoundError as e:
print(e)
print(f"Deleting entity {app_entity} {entity.name}")
frappe.db.delete(app_entity, {"name": entity.name})
# save the deleted icons
frappe.db.commit() # nosemgrep

View file

@ -145,7 +145,14 @@ frappe.request.call = function (opts) {
opts.error_callback && opts.error_callback();
},
403: function (xhr) {
if (frappe.session.user === "Guest" && frappe.session.logged_in_user !== "Guest") {
const user_id = document.cookie
.split(";")
.find((c) => c.trim().startsWith("user_id="))
?.split("=")[1];
if (
user_id === "Guest" ||
(frappe.session.user === "Guest" && frappe.session.logged_in_user !== "Guest")
) {
// session expired
frappe.app.handle_session_expired();
} else if (xhr.responseJSON && xhr.responseJSON._error_message) {