refactor(File): explicitly import utils (#22143)

This commit is contained in:
Raffael Meyer 2023-08-23 07:38:22 +02:00 committed by GitHub
parent 04a13ca97c
commit 6ea739e4cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 6 deletions

View file

@ -1,7 +1,8 @@
import json
import frappe
from frappe.core.doctype.file.file import File, setup_folder_path
from frappe.core.doctype.file.file import File
from frappe.core.doctype.file.utils import setup_folder_path
from frappe.utils import cint, cstr

View file

@ -1,2 +0,0 @@
from .exceptions import *
from .utils import *

View file

@ -22,7 +22,16 @@ from frappe.utils.file_manager import is_safe_path
from frappe.utils.image import optimize_image, strip_exif_data
from .exceptions import AttachmentLimitReached, FolderNotEmpty, MaxFileSizeReachedError
from .utils import *
from .utils import (
decode_file_content,
delete_file,
generate_file_name,
get_content_hash,
get_local_image,
get_web_image,
setup_folder_path,
update_existing_file_docs,
)
exclude_from_linked_with = True
ImageFile.LOAD_TRUNCATED_IMAGES = True

View file

@ -18,7 +18,8 @@ from email_reply_parser import EmailReplyParser
import frappe
from frappe import _, safe_decode, safe_encode
from frappe.core.doctype.file import MaxFileSizeReachedError, get_random_filename
from frappe.core.doctype.file.exceptions import MaxFileSizeReachedError
from frappe.core.doctype.file.utils import get_random_filename
from frappe.email.oauth import Oauth
from frappe.utils import (
add_days,

View file

@ -7,7 +7,7 @@ import os
import frappe
from frappe import _, scrub
from frappe.core.api.file import get_max_file_size
from frappe.core.doctype.file import remove_file_by_url
from frappe.core.doctype.file.utils import remove_file_by_url
from frappe.desk.form.meta import get_code_files_via_hooks
from frappe.modules.utils import export_module_json, get_doc_module
from frappe.rate_limiter import rate_limit