Skip to content

Commit

Permalink
feat: Periodically pdate setup wizard completion status
Browse files Browse the repository at this point in the history
  • Loading branch information
adityahase committed May 24, 2024
1 parent e63c400 commit 5aa1f66
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions press/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
],
"all": [
"press.auth.flush",
"press.press.doctype.site.sync.sync_setup_wizard_status",
],
"cron": {
"1-59/2 * * * *": [
Expand Down
27 changes: 27 additions & 0 deletions press/press/doctype/site/sync.py
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()

0 comments on commit 5aa1f66

Please sign in to comment.