Skip to content

Commit

Permalink
feat: update frappe v15 dec 17
Browse files Browse the repository at this point in the history
  • Loading branch information
sibikumarkuppusamy committed Dec 18, 2024
1 parent 2ced54d commit abca49b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions frappe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
cache = None
STANDARD_USERS = ("Guest", "Administrator")

_qb_patched = {}
_one_time_setup = {}
_dev_server = int(sbool(os.environ.get("DEV_SERVER", False)))
_tune_gc = bool(sbool(os.environ.get("FRAPPE_TUNE_GC", True)))

Expand Down Expand Up @@ -249,10 +249,11 @@ def init(site: str, sites_path: str = ".", new_site: bool = False, force=False)
local.qb.get_query = get_query
setup_redis_cache_connection()

if not _qb_patched.get(local.conf.db_type):
if not _one_time_setup.get(local.conf.db_type):
patch_query_execute()
patch_query_aggregation()
_register_fault_handler()
_one_time_setup[local.conf.db_type] = True

setup_module_map(include_all_apps=not (frappe.request or frappe.job or frappe.flags.in_migrate))

Expand Down
2 changes: 1 addition & 1 deletion frappe/email/receive.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def retrieve_message(self, uid, msg_num):

def get_email_seen_status(self, uid, flag_string):
"""parse the email FLAGS response"""
if not flag_string:
if not flag_string or not isinstance(flag_string, str | bytes):
return None

flags = []
Expand Down
3 changes: 2 additions & 1 deletion frappe/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"text/plain",
"video/quicktime",
"video/mp4",
"text/csv",
)


Expand Down Expand Up @@ -226,7 +227,7 @@ def upload_file():
if content is not None and (frappe.session.user == "Guest" or (user and not user.has_desk_access())):
filetype = guess_type(filename)[0]
if filetype not in ALLOWED_MIMETYPES:
frappe.throw(_("You can only upload JPG, PNG, PDF, TXT or Microsoft documents."))
frappe.throw(_("You can only upload JPG, PNG, PDF, TXT, CSV or Microsoft documents."))

if method:
method = frappe.get_attr(method)
Expand Down

0 comments on commit abca49b

Please sign in to comment.