Skip to content

Remove customize.py #120

@batonac

Description

@batonac

Output from bench migrate:

Loading Cloud Storage customizations

Queued rebuilding of search index

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "./apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "./apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "./env/lib/python3.12/site-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./env/lib/python3.12/site-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "./env/lib/python3.12/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./env/lib/python3.12/site-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./env/lib/python3.12/site-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./env/lib/python3.12/site-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./env/lib/python3.12/site-packages/click/decorators.py", line 34, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./apps/frappe/frappe/commands/site.py", line 694, in migrate
    ).run(site=site)
      ^^^^^^^^^^^^^^
  File "./apps/frappe/frappe/migrate.py", line 194, in run
    self.post_schema_updates()
  File "./apps/frappe/frappe/migrate.py", line 54, in wrapper
    raise e
  File "./apps/frappe/frappe/migrate.py", line 46, in wrapper
    ret = method(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "./apps/frappe/frappe/migrate.py", line 157, in post_schema_updates
    frappe.get_attr(fn)()
  File "./apps/cloud_storage/cloud_storage/customize.py", line 27, in load_customizations
    field.pop("modified")
KeyError: 'modified'

I don't know why this triggered this particular time, but neither do I understand why load_customizations is necessary as compared to the core customizations api. I do believe the fix is as simple as changing field.pop("modified") to field.pop("modified", None) in customize.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions