Merge branch 'develop' into multi_timezone_support

This commit is contained in:
Suraj Shetty 2021-11-30 09:44:33 +05:30 committed by GitHub
commit 549b36d4a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 25 deletions

View file

@ -66,7 +66,9 @@
"attach_view_link",
"prepared_report_section",
"enable_prepared_report_auto_deletion",
"prepared_report_expiry_period"
"prepared_report_expiry_period",
"system_updates_section",
"disable_system_update_notification"
],
"fields": [
{
@ -463,12 +465,24 @@
"fieldname": "encrypt_backup",
"fieldtype": "Check",
"label": "Encrypt Backups"
},
{
"collapsible": 1,
"fieldname": "system_updates_section",
"fieldtype": "Section Break",
"label": "System Updates"
},
{
"default": "0",
"fieldname": "disable_system_update_notification",
"fieldtype": "Check",
"label": "Disable System Update Notification"
}
],
"icon": "fa fa-cog",
"issingle": 1,
"links": [],
"modified": "2021-11-29 17:49:20.950033",
"modified": "2021-11-29 18:09:53.601629",
"modified_by": "Administrator",
"module": "Core",
"name": "System Settings",

View file

@ -42,16 +42,13 @@ def flush_old_route_records():
@frappe.whitelist()
def deferred_insert(routes):
routes_record = []
if isinstance(routes, str):
routes = json.loads(routes)
for route_doc in routes:
routes_record.append({
routes = [
{
"user": frappe.session.user,
"route": route_doc.get("route"),
"creation": route_doc.get("creation")
})
"route": route.get("route"),
"creation": route.get("creation"),
}
for route in frappe.parse_json(routes)
]
_deferred_insert("Route History", json.dumps(routes_record))
_deferred_insert("Route History", json.dumps(routes))

View file

@ -531,6 +531,8 @@ frappe.Application = class Application {
}
show_update_available() {
if (frappe.boot.sysdefaults.disable_system_update_notification) return;
frappe.call({
"method": "frappe.utils.change_log.show_update_popup"
});

View file

@ -4,10 +4,10 @@ const routes_to_skip = ['Form', 'social', 'setup-wizard', 'recorder'];
const save_routes = frappe.utils.debounce(() => {
if (frappe.session.user === 'Guest') return;
const routes = frappe.route_history_queue;
frappe.route_history_queue = [];
if (!routes.length) return;
frappe.route_history_queue = [];
frappe.xcall('frappe.desk.doctype.route_history.route_history.deferred_insert', {
'routes': routes
}).catch(() => {

View file

@ -155,11 +155,11 @@ def check_for_update():
for update_type in updates:
if github_version.__dict__[update_type] > instance_version.__dict__[update_type]:
updates[update_type].append(frappe._dict(
current_version = str(instance_version),
available_version = str(github_version),
org_name = org_name,
app_name = app,
title = apps[app]['title'],
current_version=str(instance_version),
available_version=str(github_version),
org_name=org_name,
app_name=app,
title=apps[app]['title'],
))
break
if github_version.__dict__[update_type] < instance_version.__dict__[update_type]: break
@ -242,7 +242,7 @@ def add_message_to_redis(update_json):
@frappe.whitelist()
def show_update_popup():
cache = frappe.cache()
user = frappe.session.user
user = frappe.session.user
update_info = cache.get_value("update-info")
if not update_info:
@ -258,10 +258,10 @@ def show_update_popup():
for app in updates[update_type]:
app = frappe._dict(app)
release_links += "<b>{title}</b>: <a href='https://github.com/{org_name}/{app_name}/releases/tag/v{available_version}'>v{available_version}</a><br>".format(
available_version = app.available_version,
org_name = app.org_name,
app_name = app.app_name,
title = app.title
available_version=app.available_version,
org_name=app.org_name,
app_name=app.app_name,
title=app.title
)
if release_links:
message = _("New {} releases for the following apps are available").format(_(update_type))