Procházet zdrojové kódy

refactor: Remove unused imports & code

version-14
chillaranand před 3 roky
rodič
revize
25f82e966c
69 změnil soubory, kde provedl 22 přidání a 125 odebrání
  1. +0
    -1
      frappe/core/doctype/activity_log/activity_log.py
  2. +0
    -1
      frappe/core/doctype/block_module/block_module.py
  3. +0
    -1
      frappe/core/doctype/communication/communication.py
  4. +0
    -2
      frappe/core/doctype/custom_docperm/test_custom_docperm.py
  5. +0
    -2
      frappe/core/doctype/custom_role/test_custom_role.py
  6. +0
    -1
      frappe/core/doctype/data_import/importer.py
  7. +0
    -2
      frappe/core/doctype/deleted_document/test_deleted_document.py
  8. +0
    -1
      frappe/core/doctype/docperm/docperm.py
  9. +1
    -1
      frappe/core/doctype/doctype/doctype.py
  10. +0
    -2
      frappe/core/doctype/domain/test_domain.py
  11. +0
    -2
      frappe/core/doctype/error_snapshot/test_error_snapshot.py
  12. +0
    -1
      frappe/core/doctype/file/file.py
  13. +0
    -1
      frappe/core/doctype/has_domain/has_domain.py
  14. +0
    -2
      frappe/core/doctype/language/test_language.py
  15. +0
    -2
      frappe/core/doctype/module_def/test_module_def.py
  16. +0
    -1
      frappe/core/doctype/patch_log/patch_log.py
  17. +0
    -2
      frappe/core/doctype/patch_log/test_patch_log.py
  18. +0
    -1
      frappe/core/doctype/payment_gateway/payment_gateway.py
  19. +0
    -2
      frappe/core/doctype/payment_gateway/test_payment_gateway.py
  20. +0
    -1
      frappe/core/doctype/sms_parameter/sms_parameter.py
  21. +0
    -2
      frappe/core/doctype/sms_settings/test_sms_settings.py
  22. +0
    -2
      frappe/core/doctype/system_settings/test_system_settings.py
  23. +0
    -1
      frappe/core/doctype/transaction_log/transaction_log.py
  24. +0
    -1
      frappe/core/doctype/user_email/user_email.py
  25. +0
    -1
      frappe/core/doctype/user_permission/user_permission.py
  26. +0
    -1
      frappe/core/doctype/view_log/view_log.py
  27. +0
    -2
      frappe/core/notifications.py
  28. +0
    -4
      frappe/core/page/background_jobs/background_jobs.py
  29. +0
    -1
      frappe/core/report/permitted_documents_for_user/permitted_documents_for_user.py
  30. +0
    -3
      frappe/core/web_form/edit_profile/edit_profile.py
  31. +0
    -1
      frappe/custom/doctype/client_script/client_script.py
  32. +0
    -2
      frappe/custom/doctype/client_script/test_client_script.py
  33. +0
    -1
      frappe/custom/doctype/customize_form_field/customize_form_field.py
  34. +0
    -2
      frappe/custom/doctype/property_setter/test_property_setter.py
  35. +0
    -1
      frappe/desk/doctype/dashboard_chart_source/dashboard_chart_source.py
  36. +0
    -1
      frappe/desk/doctype/event/event.py
  37. +0
    -2
      frappe/desk/doctype/kanban_board/test_kanban_board.py
  38. +0
    -1
      frappe/desk/doctype/kanban_board_column/kanban_board_column.py
  39. +0
    -3
      frappe/desk/doctype/list_filter/list_filter.py
  40. +0
    -1
      frappe/desk/doctype/note_seen_by/note_seen_by.py
  41. +0
    -1
      frappe/desk/doctype/notification_log/notification_log.py
  42. +1
    -1
      frappe/desk/form/load.py
  43. +0
    -2
      frappe/desk/link_preview.py
  44. +0
    -1
      frappe/desk/page/setup_wizard/install_fixtures.py
  45. +0
    -1
      frappe/email/doctype/email_flag_queue/email_flag_queue.py
  46. +0
    -2
      frappe/email/doctype/email_flag_queue/test_email_flag_queue.py
  47. +0
    -2
      frappe/email/doctype/email_group/test_email_group.py
  48. +0
    -2
      frappe/email/doctype/email_group_member/test_email_group_member.py
  49. +0
    -2
      frappe/email/doctype/email_queue/test_email_queue.py
  50. +0
    -1
      frappe/email/doctype/email_rule/email_rule.py
  51. +0
    -2
      frappe/email/doctype/email_rule/test_email_rule.py
  52. +0
    -2
      frappe/email/doctype/email_unsubscribe/test_email_unsubscribe.py
  53. +0
    -1
      frappe/email/doctype/newsletter/test_newsletter.py
  54. +0
    -1
      frappe/email/doctype/newsletter_email_group/newsletter_email_group.py
  55. +0
    -1
      frappe/email/doctype/notification_recipient/notification_recipient.py
  56. +0
    -2
      frappe/email/doctype/unhandled_email/test_unhandled_email.py
  57. +1
    -3
      frappe/email/smtp.py
  58. +0
    -1
      frappe/geo/doctype/country/country.py
  59. +0
    -1
      frappe/geo/doctype/currency/currency.py
  60. +0
    -1
      frappe/tests/test_commands.py
  61. +1
    -3
      frappe/tests/test_scheduler.py
  62. +1
    -1
      frappe/utils/dashboard.py
  63. +2
    -2
      frappe/utils/doctor.py
  64. +1
    -11
      frappe/utils/file_manager.py
  65. +3
    -5
      frappe/utils/identicon.py
  66. +1
    -1
      frappe/utils/nestedset.py
  67. +1
    -1
      frappe/utils/print_format.py
  68. +2
    -4
      frappe/workflow/doctype/workflow_action/workflow_action.py
  69. +7
    -5
      frappe/www/login.py

+ 0
- 1
frappe/core/doctype/activity_log/activity_log.py Zobrazit soubor

@@ -2,7 +2,6 @@
# License: MIT. See LICENSE

import frappe
from frappe import _
from frappe.core.utils import set_timeline_doc
from frappe.model.document import Document
from frappe.query_builder import DocType, Interval


+ 0
- 1
frappe/core/doctype/block_module/block_module.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 1
frappe/core/doctype/communication/communication.py Zobrazit soubor

@@ -20,7 +20,6 @@ from frappe.core.doctype.communication.mixins import CommunicationEmailMixin
from frappe.core.utils import get_parent_doc
from frappe.model.document import Document
from frappe.utils import (
cstr,
parse_addr,
split_emails,
strip_html,


+ 0
- 2
frappe/core/doctype/custom_docperm/test_custom_docperm.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Custom DocPerm')




+ 0
- 2
frappe/core/doctype/custom_role/test_custom_role.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Custom Role')




+ 0
- 1
frappe/core/doctype/data_import/importer.py Zobrazit soubor

@@ -11,7 +11,6 @@ import frappe
from frappe import _
from frappe.core.doctype.version.version import get_diff
from frappe.model import no_value_fields
from frappe.model import table_fields as table_fieldtypes
from frappe.utils import cint, cstr, duration_to_seconds, flt, update_progress_bar
from frappe.utils.csvutils import get_csv_content_from_google_sheets, read_csv_content
from frappe.utils.xlsxutils import (


+ 0
- 2
frappe/core/doctype/deleted_document/test_deleted_document.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Deleted Document')




+ 0
- 1
frappe/core/doctype/docperm/docperm.py Zobrazit soubor

@@ -1,7 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 1
- 1
frappe/core/doctype/doctype/doctype.py Zobrazit soubor

@@ -32,7 +32,7 @@ from frappe.model.meta import Meta
from frappe.modules import get_doc_path, make_boilerplate
from frappe.modules.import_file import get_file_path
from frappe.query_builder.functions import Concat
from frappe.utils import cint, now
from frappe.utils import cint
from frappe.website.utils import clear_cache




+ 0
- 2
frappe/core/doctype/domain/test_domain.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe


class TestDomain(unittest.TestCase):
pass

+ 0
- 2
frappe/core/doctype/error_snapshot/test_error_snapshot.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Error Snapshot')




+ 0
- 1
frappe/core/doctype/file/file.py Zobrazit soubor

@@ -41,7 +41,6 @@ from frappe.utils.file_manager import safe_b64decode
from frappe.utils.image import optimize_image, strip_exif_data

if TYPE_CHECKING:
from PIL.ImageFile import ImageFile
from requests.models import Response




+ 0
- 1
frappe/core/doctype/has_domain/has_domain.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2017, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/core/doctype/language/test_language.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Language')




+ 0
- 2
frappe/core/doctype/module_def/test_module_def.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Module Def')




+ 0
- 1
frappe/core/doctype/patch_log/patch_log.py Zobrazit soubor

@@ -3,7 +3,6 @@

# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/core/doctype/patch_log/test_patch_log.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Patch Log')




+ 0
- 1
frappe/core/doctype/payment_gateway/payment_gateway.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/core/doctype/payment_gateway/test_payment_gateway.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Payment Gateway')




+ 0
- 1
frappe/core/doctype/sms_parameter/sms_parameter.py Zobrazit soubor

@@ -1,7 +1,6 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/core/doctype/sms_settings/test_sms_settings.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe


class TestSMSSettings(unittest.TestCase):
pass

+ 0
- 2
frappe/core/doctype/system_settings/test_system_settings.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe


class TestSystemSettings(unittest.TestCase):
pass

+ 0
- 1
frappe/core/doctype/transaction_log/transaction_log.py Zobrazit soubor

@@ -4,7 +4,6 @@
import hashlib

import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder import DocType
from frappe.utils import cint, now_datetime


+ 0
- 1
frappe/core/doctype/user_email/user_email.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2015, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 1
frappe/core/doctype/user_permission/user_permission.py Zobrazit soubor

@@ -8,7 +8,6 @@ from frappe import _
from frappe.core.utils import find
from frappe.desk.form.linked_with import get_linked_doctypes
from frappe.model.document import Document
from frappe.permissions import get_valid_perms, update_permission_property
from frappe.utils import cstr




+ 0
- 1
frappe/core/doctype/view_log/view_log.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2018, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/core/notifications.py Zobrazit soubor

@@ -2,8 +2,6 @@
# License: MIT. See LICENSE

import frappe
from frappe.query_builder import DocType, Interval
from frappe.query_builder.functions import Now


def get_notification_config():


+ 0
- 4
frappe/core/page/background_jobs/background_jobs.py Zobrazit soubor

@@ -1,13 +1,9 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE

import json
from typing import TYPE_CHECKING, Dict, List

from rq import Worker

import frappe
from frappe import _
from frappe.utils import convert_utc_to_user_timezone
from frappe.utils.background_jobs import get_queues, get_workers
from frappe.utils.scheduler import is_scheduler_inactive


+ 0
- 1
frappe/core/report/permitted_documents_for_user/permitted_documents_for_user.py Zobrazit soubor

@@ -3,7 +3,6 @@

import frappe
import frappe.utils.user
from frappe import _, throw
from frappe.model import data_fieldtypes
from frappe.permissions import check_admin_or_system_manager, rights



+ 0
- 3
frappe/core/web_form/edit_profile/edit_profile.py Zobrazit soubor

@@ -1,6 +1,3 @@
import frappe


def get_context(context):
# do your magic here
pass

+ 0
- 1
frappe/custom/doctype/client_script/client_script.py Zobrazit soubor

@@ -1,7 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe import _
from frappe.model.document import Document




+ 0
- 2
frappe/custom/doctype/client_script/test_client_script.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Client Script')




+ 0
- 1
frappe/custom/doctype/customize_form_field/customize_form_field.py Zobrazit soubor

@@ -1,7 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/custom/doctype/property_setter/test_property_setter.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Property Setter')




+ 0
- 1
frappe/desk/doctype/dashboard_chart_source/dashboard_chart_source.py Zobrazit soubor

@@ -5,7 +5,6 @@
import os

import frappe
from frappe import _
from frappe.model.document import Document
from frappe.modules import get_module_path, scrub
from frappe.modules.export_file import export_to_files


+ 0
- 1
frappe/desk/doctype/event/event.py Zobrazit soubor

@@ -18,7 +18,6 @@ from frappe.utils import (
cstr,
date_diff,
format_datetime,
get_datetime,
get_datetime_str,
getdate,
now_datetime,


+ 0
- 2
frappe/desk/doctype/kanban_board/test_kanban_board.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Kanban Board')




+ 0
- 1
frappe/desk/doctype/kanban_board_column/kanban_board_column.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2015, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 3
frappe/desk/doctype/list_filter/list_filter.py Zobrazit soubor

@@ -2,9 +2,6 @@
# Copyright (c) 2018, Frappe Technologies and contributors
# License: MIT. See LICENSE

import json

import frappe
from frappe.model.document import Document




+ 0
- 1
frappe/desk/doctype/note_seen_by/note_seen_by.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2015, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 1
frappe/desk/doctype/notification_log/notification_log.py Zobrazit soubor

@@ -7,7 +7,6 @@ from frappe import _
from frappe.desk.doctype.notification_settings.notification_settings import (
is_email_notifications_enabled_for_type,
is_notifications_enabled,
set_seen_value,
)
from frappe.model.document import Document



+ 1
- 1
frappe/desk/form/load.py Zobrazit soubor

@@ -2,7 +2,7 @@
# License: MIT. See LICENSE

import json
from typing import Dict, List, Union
from typing import List, Union
from urllib.parse import quote

import frappe


+ 0
- 2
frappe/desk/link_preview.py Zobrazit soubor

@@ -1,5 +1,3 @@
import json

import frappe
from frappe.model import no_value_fields, table_fields



+ 0
- 1
frappe/desk/page/setup_wizard/install_fixtures.py Zobrazit soubor

@@ -2,7 +2,6 @@
# License: MIT. See LICENSE

import frappe
from frappe import _
from frappe.desk.doctype.global_search_settings.global_search_settings import (
update_global_search_doctypes,
)


+ 0
- 1
frappe/email/doctype/email_flag_queue/email_flag_queue.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2015, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/email/doctype/email_flag_queue/test_email_flag_queue.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Email Flag Queue')




+ 0
- 2
frappe/email/doctype/email_group/test_email_group.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Email Group')




+ 0
- 2
frappe/email/doctype/email_group_member/test_email_group_member.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Email Group Member')




+ 0
- 2
frappe/email/doctype/email_queue/test_email_queue.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Email Queue')




+ 0
- 1
frappe/email/doctype/email_rule/email_rule.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2017, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/email/doctype/email_rule/test_email_rule.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe


class TestEmailRule(unittest.TestCase):
pass

+ 0
- 2
frappe/email/doctype/email_unsubscribe/test_email_unsubscribe.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Email Unsubscribe')




+ 0
- 1
frappe/email/doctype/newsletter/test_newsletter.py Zobrazit soubor

@@ -7,7 +7,6 @@ from typing import Union
from unittest.mock import MagicMock, PropertyMock, patch

import frappe
from frappe.desk.form.load import run_onload
from frappe.email.doctype.newsletter.exceptions import (
NewsletterAlreadySentError,
NoRecipientFoundError,


+ 0
- 1
frappe/email/doctype/newsletter_email_group/newsletter_email_group.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2015, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 1
frappe/email/doctype/notification_recipient/notification_recipient.py Zobrazit soubor

@@ -2,7 +2,6 @@
# Copyright (c) 2018, Frappe Technologies and contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 2
frappe/email/doctype/unhandled_email/test_unhandled_email.py Zobrazit soubor

@@ -3,8 +3,6 @@
# License: MIT. See LICENSE
import unittest

import frappe

# test_records = frappe.get_test_records('Unhandled Emails')




+ 1
- 3
frappe/email/smtp.py Zobrazit soubor

@@ -1,15 +1,13 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE

import email.utils
import smtplib
import sys

import _socket

import frappe
from frappe import _
from frappe.utils import cint, cstr, parse_addr
from frappe.utils import cint, cstr

CONNECTION_FAILED = _("Could not connect to outgoing email server")
AUTH_ERROR_TITLE = _("Invalid Credentials")


+ 0
- 1
frappe/geo/doctype/country/country.py Zobrazit soubor

@@ -1,7 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE

import frappe
from frappe.model.document import Document




+ 0
- 1
frappe/geo/doctype/currency/currency.py Zobrazit soubor

@@ -2,7 +2,6 @@
# License: MIT. See LICENSE

import frappe
from frappe import _, throw
from frappe.model.document import Document




+ 0
- 1
frappe/tests/test_commands.py Zobrazit soubor

@@ -7,7 +7,6 @@ import importlib
import json
import os
import shlex
import shutil
import subprocess
import unittest
from contextlib import contextmanager


+ 1
- 3
frappe/tests/test_scheduler.py Zobrazit soubor

@@ -1,12 +1,10 @@
import time
from unittest import TestCase

from dateutil.relativedelta import relativedelta

import frappe
from frappe.core.doctype.scheduled_job_type.scheduled_job_type import sync_jobs
from frappe.utils import add_days, get_datetime
from frappe.utils.background_jobs import enqueue, get_jobs
from frappe.utils.background_jobs import enqueue
from frappe.utils.doctor import purge_pending_jobs
from frappe.utils.scheduler import enqueue_events, is_dormant, schedule_jobs_based_on_activity



+ 1
- 1
frappe/utils/dashboard.py Zobrazit soubor

@@ -7,7 +7,7 @@ from os.path import join
import frappe
from frappe import _
from frappe.modules.import_file import import_file_by_path
from frappe.utils import add_to_date, cint, get_link_to_form
from frappe.utils import cint, get_link_to_form


def cache_source(function):


+ 2
- 2
frappe/utils/doctor.py Zobrazit soubor

@@ -20,8 +20,8 @@ def purge_pending_jobs(event=None, site=None, queue=None):
mintues and would any leave daily, hourly and weekly tasks
"""
purged_task_count = 0
for queue in get_queue_list(queue):
q = get_queue(queue)
for _queue in get_queue_list(queue):
q = get_queue(_queue)
for job in q.jobs:
if site and event:
if job.kwargs["site"] == site and job.kwargs["event"] == event:


+ 1
- 11
frappe/utils/file_manager.py Zobrazit soubor

@@ -7,23 +7,13 @@ import io
import json
import mimetypes
import os
import re
from copy import copy
from urllib.parse import unquote

import frappe
from frappe import _, conf
from frappe.query_builder.utils import DocType
from frappe.utils import (
call_hook_method,
cint,
cstr,
encode,
get_files_path,
get_hook_method,
random_string,
)
from frappe.utils.image import optimize_image
from frappe.utils import call_hook_method, cint, cstr, encode, get_files_path, get_hook_method


class MaxFileSizeReachedError(frappe.ValidationError):


+ 3
- 5
frappe/utils/identicon.py Zobrazit soubor

@@ -100,8 +100,6 @@ class Identicon(object):
if format.upper() not in Image.SAVE:
Image.init()
save_handler = Image.SAVE[format.upper()]
try:
save_handler(self.image, fp, "")
finally:
fp.seek(0)
return "data:image/png;base64,{0}".format(base64.b64encode(fp.read()))
save_handler(self.image, fp, "")
fp.seek(0)
return "data:image/png;base64,{0}".format(base64.b64encode(fp.read()))

+ 1
- 1
frappe/utils/nestedset.py Zobrazit soubor

@@ -15,7 +15,7 @@ from typing import Iterator
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.query_builder import DocType, Order
from frappe.query_builder import Order
from frappe.query_builder.functions import Coalesce, Max
from frappe.query_builder.utils import DocType



+ 1
- 1
frappe/utils/print_format.py Zobrazit soubor

@@ -5,7 +5,7 @@ from PyPDF2 import PdfFileWriter
import frappe
from frappe import _
from frappe.core.doctype.access_log.access_log import make_access_log
from frappe.utils.pdf import cleanup, get_pdf
from frappe.utils.pdf import get_pdf

no_cache = 1



+ 2
- 4
frappe/workflow/doctype/workflow_action/workflow_action.py Zobrazit soubor

@@ -197,7 +197,7 @@ def update_completed_workflow_actions(doc, user=None, workflow=None, workflow_st
if not allowed_roles:
return
if workflow_action := get_workflow_action_by_role(doc, allowed_roles):
update_completed_workflow_actions_using_role(doc, user, allowed_roles, workflow_action)
update_completed_workflow_actions_using_role(user, workflow_action)
else:
# backwards compatibility
# for workflow actions saved using user
@@ -238,9 +238,7 @@ def get_workflow_action_by_role(doc, allowed_roles):
).run(as_dict=True)


def update_completed_workflow_actions_using_role(
doc, user=None, allowed_roles=set(), workflow_action=None
):
def update_completed_workflow_actions_using_role(user=None, workflow_action=None):
user = user if user else frappe.session.user
WorkflowAction = DocType("Workflow Action")



+ 7
- 5
frappe/www/login.py Zobrazit soubor

@@ -1,8 +1,6 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE

import json

import frappe
import frappe.utils
from frappe import _
@@ -11,9 +9,13 @@ from frappe.integrations.doctype.ldap_settings.ldap_settings import LDAPSettings
from frappe.integrations.oauth2_logins import decoder_compat
from frappe.utils.html_utils import get_icon_html
from frappe.utils.jinja import guess_is_path
from frappe.utils.oauth import get_oauth2_authorize_url, get_oauth_keys
from frappe.utils.oauth import login_oauth_user as _login_oauth_user
from frappe.utils.oauth import login_via_oauth2, login_via_oauth2_id_token, redirect_post_login
from frappe.utils.oauth import (
get_oauth2_authorize_url,
get_oauth_keys,
login_via_oauth2,
login_via_oauth2_id_token,
redirect_post_login,
)
from frappe.utils.password import get_decrypted_password
from frappe.website.utils import get_home_page



Načítá se…
Zrušit
Uložit