-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Periodically pdate setup wizard completion status
- Loading branch information
1 parent
e63c400
commit 5aa1f66
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) 2024, Frappe and contributors | ||
# For license information, please see license.txt | ||
|
||
import frappe | ||
|
||
|
||
def sync_setup_wizard_status(): | ||
sites = frappe.get_all( | ||
"Site", | ||
{ | ||
"status": "Active", | ||
"setup_wizard_complete": False, | ||
"is_standby": False, | ||
"domain": ("in", ("erpnext.com", "frappe.cloud", "frappehr.com", "frappedesk.com")), | ||
}, | ||
pluck="name", | ||
order_by="RAND()", | ||
limit=20, | ||
) | ||
|
||
for site_name in sites: | ||
site = frappe.get_doc("Site", site_name) | ||
try: | ||
site.is_setup_wizard_complete() | ||
frappe.db.commit() | ||
except Exception: | ||
frappe.db.rollback() |