brotherton-erpnext/erpnext/utilities/regional.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
216 B
Python
Raw Normal View History

from contextlib import contextmanager
import frappe
@contextmanager
def temporary_flag(flag_name, value):
flags = frappe.local.flags
flags[flag_name] = value
try:
yield
finally:
flags.pop(flag_name, None)