Browse Source

chore: revert potentially breaking changes

version-14
Ankush Menat 2 years ago
committed by GitHub
parent
commit
a445b7a391
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions
  1. +1
    -0
      frappe/auth.py
  2. +7
    -0
      frappe/modules/patch_handler.py

+ 1
- 0
frappe/auth.py View File

@@ -8,6 +8,7 @@ import frappe.utils
import frappe.utils.user
from frappe import _
from frappe.core.doctype.activity_log.activity_log import add_authentication_log
from frappe.modules.patch_handler import check_session_stopped
from frappe.sessions import Session, clear_sessions, delete_session
from frappe.translate import get_language
from frappe.twofactor import (


+ 7
- 0
frappe/modules/patch_handler.py View File

@@ -220,3 +220,10 @@ def _patch_mode(enable):
"""stop/start execution till patch is run"""
frappe.local.flags.in_patch = enable
frappe.db.commit()


def check_session_stopped():
"""This function is deprecated. Use maintenance_mode in site config instead."""
if frappe.db.get_global("__session_status") == "stop":
frappe.msgprint(frappe.db.get_global("__session_status_message"))
raise frappe.SessionStopped("Session Stopped")

Loading…
Cancel
Save