No description
Find a file
David Arnold 3c1392c8fd
fix: meta signature (#28526)
* fix: meta

* fix: test case

save is required:

1. Fetch values
```python
	def get_invalid_links(self, is_submittable=False):
		"""Return list of invalid links and also update fetch values if not set."""
		...
```

2. Is triggered by
```python

	def _validate_links(self):
		if self.flags.ignore_links or self._action == "cancel":
			return
        ...
```

3. Which is triggered by either `_save` or `insert`

----

`reload` does not trigger link fetch
```python
	def reload(self) -> "Self":
		"""Reload document from database"""
		return self.load_from_db()
```

Neither does the new calling path which does not excempt Document
from caching when initializing meta.

It can be proven that this revert would be an alternative fix. But this
seems design by accident and there's no preceivable reason to excempt
Document args from being cached normally.

diff --git a/frappe/model/meta.py b/frappe/model/meta.py
index c4321f0128..87452c812c 100644
--- a/frappe/model/meta.py
+++ b/frappe/model/meta.py
@@ -70,11 +70,10 @@ def get_meta(doctype: str | dict | DocRef, cached=True) -> "_Meta":
 	Returns:
 	    Meta object for the given doctype.
 	"""
-	if cached and (
-		doctype_name := getattr(doctype, "doctype", doctype)
-		if not isinstance(doctype, dict)
-		else doctype.get("doctype")
-	):
+	if cached and not isinstance(doctype, Document):
+		doctype_name = (
+			getattr(doctype, "doctype", doctype) if not isinstance(doctype, dict) else doctype.get("doctype")
+		)
 		if meta := frappe.cache.hget("doctype_meta", doctype_name):
 			return meta

Therefore, we comply the test.
2024-11-20 04:17:38 +00:00
.github ci: polish reusable workflows (#28521) 2024-11-19 21:50:32 +00:00
billing chore: updated README 2024-11-19 11:04:09 +05:30
cypress test: Scroll list_title into view 2024-10-21 12:17:04 +05:30
esbuild fix: post install also install billing dependencies 2024-11-14 16:08:26 +05:30
frappe fix: meta signature (#28526) 2024-11-20 04:17:38 +00:00
realtime chore: linting 2024-06-21 17:26:16 +05:30
tests feat: add read only document mode 2024-10-02 12:02:52 +02:00
.coveragerc ci: Add Coveragerc (#22530) 2023-10-16 18:24:16 +05:30
.editorconfig chore: ignore helix folder 2024-08-29 14:28:52 +02:00
.eslintignore fix: Miscellaneous changes (#12343) 2021-02-08 12:05:37 +05:30
.eslintrc fix: All ESLint errors 2023-07-14 15:25:48 +05:30
.git-blame-ignore-revs chore: Add caching decorators docstring changes to git blame ignore 2024-11-10 12:42:39 +05:30
.gitignore fix: post install also install billing dependencies 2024-11-14 16:08:26 +05:30
.mergify.yml chore: disable mergify auto merges (#24825) 2024-02-09 13:59:40 +00:00
.pre-commit-config.yaml fix(style): sidebar changes and restore pre-commit 2024-10-23 17:17:09 +05:30
.releaserc ci: better release notes generation (#19380) 2022-12-21 12:14:35 +05:30
.semgrepignore refactor!: Prefix all custom fieldnames created from Desk (#21355) 2023-06-19 18:22:36 +05:30
attributions.md refactor: Itenticon 2022-08-11 23:53:21 +05:30
babel_extractors.csv fix: extract translatable strings from the whole repo (#27848) 2024-09-24 15:55:46 +02:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2017-09-12 09:14:34 +05:30
codecov.yml ci: update codecov.yml flags 2023-01-10 13:19:12 +05:30
CODEOWNERS chore: simple codeowners 2023-07-25 13:06:49 +05:30
commitlint.config.js chore: add depr to commit types for deprecation decisions 2024-11-13 11:20:10 +01:00
crowdin.yml chore: update crowdin configuration (#25240) 2024-03-05 20:57:50 +05:30
cypress.config.js test: fix cypress tests (#26012) 2024-04-17 15:26:18 +00:00
generate_bootstrap_theme.js chore: remove eslint-disable* 2023-07-14 15:41:20 +05:30
hooks.md chore!: remove dead hooks app_icon & app_color 2022-05-10 14:41:01 +05:30
LICENSE chore: Update copyright until date to 2021 2021-09-03 12:19:15 +05:30
node_utils.js feat: prepare redis subsystem for unix domain socket connections 2024-03-29 10:12:19 +01:00
package.json fix: post install also install billing dependencies 2024-11-14 16:08:26 +05:30
pyproject.toml chore: start with type checking (#28190) 2024-10-24 21:56:25 +00:00
README.md chore(README): remove missed extra space between links to fix link underlines 2024-10-25 11:44:37 +05:30
SECURITY.md Update SECURITY.md 2023-01-10 16:49:44 +05:30
sider.yml chore(sider): add sider default config for flake8 + ignore tab errors (W191) (#12587) 2021-03-16 17:07:41 +05:30
socketio.js refactor: Split socketio in multiple logical files 2023-07-01 10:53:34 +05:30
yarn.lock chore(deps): bump cookie from 0.4.2 to 0.7.0 2024-10-07 10:54:33 +00:00

a web framework with "batteries included"

it's pronounced - fra-pay

Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for ERPNext.

Try in PWD

Login for the PWD site: (username: Administrator, password: admin)

Table of Contents

Installation

Production

Development

Contributing

  1. Code of Conduct
  2. Contribution Guidelines
  3. Security Policy

Resources

  1. frappeframework.com - Official documentation of the Frappe Framework.
  2. frappe.school - Pick from the various courses by the maintainers or from the community.
  3. buildwithhussain.dev - Watch Frappe Framework being used in the wild to build world-class web apps.

License

This repository has been released under the MIT License.

By contributing to Frappe, you agree that your contributions will be licensed under its MIT License.