Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the JSON object must be str, bytes or bytearray, not NoneType #2546

Open
1 task done
njbhatt18 opened this issue Dec 24, 2024 · 0 comments
Open
1 task done

the JSON object must be str, bytes or bytearray, not NoneType #2546

njbhatt18 opened this issue Dec 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@njbhatt18
Copy link

Information about bug

Reported Error in Leave Application

Module

HR

Version

ERPNext: v15.46.2 (version-15)
Frappe Framework: v15.50.1 (version-15)
Frappe HR: v15.36.1 (version-15)
India Compliance: v15.14.6 (version-15)

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

Traceback with variables (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, in application
    response = frappe.api.handle(request)
      request = <Request 'https://erp.techseria.com/api/method/hrms.hr.doctype.leave_application.leave_application.get_events?doctype=Leave%20Application&start=2024-11-25%2000:00:00&end=2025-01-06%2000:00:00&field_map={"start":"from_date","end":"to_date","id":"name","title":"title","docstatus":1,"color":"color"}' [GET]>
      response = None
      rollback = True
      e = TypeError('the JSON object must be str, bytes or bytearray, not NoneType')
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
      request = <Request 'https://erp.techseria.com/api/method/hrms.hr.doctype.leave_application.leave_application.get_events?doctype=Leave%20Application&start=2024-11-25%2000:00:00&end=2025-01-06%2000:00:00&field_map={"start":"from_date","end":"to_date","id":"name","title":"title","docstatus":1,"color":"color"}' [GET]>
      endpoint = <function handle_rpc_call at 0xf52d27420d60>
      arguments = {'method': 'hrms.hr.doctype.leave_application.leave_application.get_events'}
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
      method = 'hrms.hr.doctype.leave_application.leave_application.get_events'
      frappe = <module 'frappe' from 'apps/frappe/frappe/__init__.py'>
  File "apps/frappe/frappe/handler.py", line 50, in handle
    data = execute_cmd(cmd)
      cmd = 'hrms.hr.doctype.leave_application.leave_application.get_events'
      data = None
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
      cmd = 'hrms.hr.doctype.leave_application.leave_application.get_events'
      from_async = False
      server_script = None
      method = <function get_events at 0xf52d1c398860>
  File "apps/frappe/frappe/__init__.py", line 1726, in call
    return fn(*args, **newargs)
      fn = <function get_events at 0xf52d1c398860>
      args = ()
      kwargs = {'doctype': 'Leave Application', 'start': '2024-11-25 00:00:00', 'end': '2025-01-06 00:00:00', 'field_map': '{"start":"from_date","end":"to_date","id":"name","title":"title","docstatus":1,"color":"color"}', 'cmd': 'hrms.hr.doctype.leave_application.leave_application.get_events'}
      newargs = {'start': '2024-11-25 00:00:00', 'end': '2025-01-06 00:00:00'}
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
      args = ()
      kwargs = {'start': '2024-11-25 00:00:00', 'end': '2025-01-06 00:00:00'}
      apply_condition = <function whitelist.<locals>.innerfn.<locals>.<lambda> at 0xf52d1c3987c0>
      func = <function get_events at 0xf52d1c398720>
  File "apps/hrms/hrms/hr/doctype/leave_application/leave_application.py", line 1181, in get_events
    filters = json.loads(filters)
      start = '2024-11-25 00:00:00'
      end = '2025-01-06 00:00:00'
      filters = None
      json = <module 'json' from '/usr/lib/python3.11/json/__init__.py'>
  File "/usr/lib/python3.11/json/__init__.py", line 339, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
      s = None
      cls = None
      object_hook = None
      parse_float = None
      parse_int = None
      parse_constant = None
      object_pairs_hook = None
      kw = {}
builtins.TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Code of Conduct

  • I agree to follow this project's Code of Conduct
@njbhatt18 njbhatt18 added the bug Something isn't working label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant