fix(UX): Better message for read only mode

- The default message keeps confusing user because it doesn't contain the word "site update" which is usually the reason for putting site in read only mode.
- Also fixes annoying popup while opening notifications in read only mode.

[skip ci]
This commit is contained in:
Ankush Menat 2023-02-27 14:03:34 +05:30
parent 6a37c19d0e
commit 9321a2e86a
3 changed files with 5 additions and 2 deletions

View file

@ -233,7 +233,7 @@ class Database:
elif self.is_read_only_mode_error(e):
frappe.throw(
_(
"Site is running in read only mode, this action can not be performed right now. Please try again later."
"Site is running in read only mode for maintenance or site update, this action can not be performed right now. Please try again later."
),
title=_("In Read Only Mode"),
exc=frappe.InReadOnlyMode,

View file

@ -92,4 +92,7 @@ def get_permission_query_conditions(user):
@frappe.whitelist()
def set_seen_value(value, user):
if frappe.flags.read_only:
return
frappe.db.set_value("Notification Settings", user, "seen", value, update_modified=False)

View file

@ -7,7 +7,7 @@
<div class="collapse navbar-collapse justify-content-end">
<form class="form-inline fill-width justify-content-end" role="search" onsubmit="return false;">
{% if (frappe.boot.read_only) { %}
<span class="indicator-pill yellow no-indicator-dot" title="{%= __("Your site is getting upgraded.") %}">
<span class="indicator-pill yellow no-indicator-dot" title="{%= __("Your site is undergoing maintenance or being updated.") %}">
{%= __("Read Only Mode") %}
</span>
{% } %}