Commit graph

1771 commits

Author SHA1 Message Date
Akhil Narang
e6be7d6648
fix(setup_module_map): fix caching
Use a separate cache key depending on the arguments passed

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-28 17:41:18 +05:30
Ankush Menat
dbc2e092f1 fix: escalate print failures
Print failures shouldn't generate PDF with failure message but instead escalate the error.

This prevent all the PDFs that just contain "PermissionError" from being sent.
2024-02-28 16:42:03 +05:30
Ankush Menat
2588de6384
fix: invalid lru_cache usage (#25046)
- using it on closure is useless because a new cache is created
and destroyed everytime.
2024-02-24 12:04:18 +05:30
Ankush Menat
1ff7b84140
fix: wrap read_only functions correctly (#25018)
`functools.wraps` preserves signature useful for introspection.
2024-02-22 11:16:15 +00:00
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Ankush Menat
3aa7fd77ed
fix: patch QB before setup_module_map (#24981)
This function if cache isn't available CAN result in a DB query, this
will cause cold starts to fail because QB is not yet patched.
2024-02-21 09:57:50 +00:00
Ankush Menat
64a5ebb112
refactor!: Drop user based workflow action compatibility (#24956)
* test: run workflow actions in tests

* test: fix workflow action tests

* refactor!: Remove compatibility with `user` based workflow action

* test: cleanup test cleanups

* fix: restore form dict after printing

* test: patch printing during workflow tests
2024-02-20 14:37:13 +00:00
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
7b83fceadc
Merge pull request #24782 from ankush/file_locking_changes
feat: let users unlock stuck documents
2024-02-06 13:19:53 +05:30
Ankush Menat
40f1ae1cce feat: support primary_action for frappe.throw 2024-02-06 12:55:29 +05:30
Akhil Narang
986e8bc766
feat: include only installed apps in module map in certain scenarios
"all" apps are only really needed during setup, installation of new apps, etc.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-06 11:32:56 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Akhil Narang
54ba72ba74
feat: allow extending site config with a hook
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-05 11:43:21 +05:30
Akhil Narang
f19c25ec42
Merge pull request #24432 from blaggacao/chore/cleanup-frappe-connect-2
chore: cleanup frappe connect II/II
2024-02-02 16:53:19 +05:30
Ankush Menat
aad0c19f3a
fix: lazy translate circular imports (#24672)
* Revert "fix: remove _lt from frappe.model.std_fields (#24662)"

This reverts commit 833d108614.

* fix: circular import
2024-02-01 12:27:25 +00:00
David Arnold
161bb42508
fix: deprioritize precedence of db_name argument to connect 2024-01-31 09:59:14 +01:00
Ankush Menat
d53a0ae45e
Revert "fix(module_map): only include apps installed on the site - not everything on the bench" (#24605) 2024-01-30 07:39:09 +00:00
Akhil Narang
db72dd37aa
refactor: fallback to all apps on bench when site isn't ready yet
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-29 17:31:52 +05:30
Akhil Narang
f967aa9508
feat: print a warning if module names conflict
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-29 17:25:37 +05:30
Akhil Narang
f48ec5b690
refactor(module_map): fetch only installed apps if a site is initialized
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-29 17:25:37 +05:30
David Arnold
e7284be5a3
fix: remove db name 'hack'; now the code path is clean 2024-01-24 11:56:23 +01:00
David Arnold
25168b858f
feat: db_user can be set by env varbiable
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2024-01-24 11:56:23 +01:00
David Arnold
78aad52b2c
fix: default db_user where config defaults are set 2024-01-21 18:24:22 +01:00
David Arnold
f1bcdabb6c
fix: assert minimum contract for frappe.connect 2024-01-21 18:24:18 +01:00
David Arnold
94378b6566
chore: simplify frappe.connect and use site config for bootstrapping 2024-01-19 13:49:36 +01:00
David Arnold
7bec22e238
Merge remote-tracking branch 'origin/develop' into chore/cleanup-low-level-db-interface 2024-01-18 13:22:33 +01:00
David Arnold
2b16450cf0
chore: keep frappe.connect backwards compatible for a while 2024-01-18 12:40:25 +01:00
David Arnold
f889d09d0b
fix: set defaults at the highest level interface 2024-01-17 18:59:34 +01:00
David Arnold
d87092936f
chore: simplify frappe.connect & require explicit site initialization 2024-01-17 16:53:30 +01:00
Akhil Narang
ed05acd3d0
refactor(replica): allow using separate db user name
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 12:35:01 +05:30
Akhil Narang
7419da64a1
fix: set a fallback for db user in connect()
In case we don't have a site name, `init()` won't be called, and we won't have a username

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 12:35:01 +05:30
Akhil Narang
c721fcf8c4
refactor: allow setting a db user name different from the database name
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 12:35:01 +05:30
Ankush Menat
cbf6faccb5 fix(DX): Print available sites when URL is invalid 2024-01-15 12:30:43 +05:30
Ankush Menat
447f02e8d3
fix!: Remove misleading "raise_exception" (#24266)
frappe.permission.has_permission won't accept raise_exception anymore,
it was extremely misleading argument and actual purpose of the argument
was to print perm check logs.
2024-01-11 08:24:18 +00:00
Ankush Menat
98b62e8220 fix: add _lt to extractors 2024-01-10 21:47:55 +05:30
Ankush Menat
1f6201b4af feat: lazy global translated strings 2024-01-10 21:28:01 +05:30
Ankush Menat
914406d31b feat: extend perm debugging to popular controllers
- [x] File
- [x] Communication
2024-01-10 15:16:52 +05:30
Ankush Menat
94f53d3f91 fix!: frappe.has_permission(throw=True) works as expected
- This wasn't throwing PermissionError
- It was erasing all perm check messages
2024-01-04 10:37:07 +05:30
Ankush Menat
e296a81ed9
refactor: remove dead handling for "fnargs" (#24064)
This was added for some function here: 2dd28afcb7 (diff-4a7c68f7105f3a52a7504ce52ab85bd106df91e69ab07a9f12fe23dc258870a6R266)

It's not used anywhere.
2024-01-02 05:55:15 +00:00
Akhil Narang
067104ca9c
refactor(sentry): sync up with FC implementation
Co-authored-by: Aditya Hase <aditya@adityahase.com>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 12:30:10 +05:30
Ankush Menat
5e2ace4c08
perf: Use set for tracking whitelisted methods (#23905)
List look ups are O(N). This is still a microoptimization at best
considering other overhead.
2023-12-21 23:19:06 +05:30
Hussain Nagaria
c70229cd69 docs: consistency 2023-12-19 12:55:41 +05:30
Hussain Nagaria
370d575f29 docs: some more utils 2023-12-18 22:27:58 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
Hussain Nagaria
75d81da634 fix: unicode handles more than just str 2023-12-17 16:35:29 +05:30
Hussain Nagaria
cf28fe2da4 fix: consistency 2023-12-17 00:29:48 +05:30
Hussain Nagaria
1a2d8fe78a docs: get_system_settings
* IMO this should be renamed to something like `get_from_system_settings`
2023-12-16 22:18:31 +05:30
Hussain Nagaria
0fa0d1ff0e docs: frappe.bold 2023-12-16 16:48:11 +05:30
Hussain Nagaria
d5ccb51251 docs: frappe.as_json 2023-12-16 14:25:39 +05:30
Ankush Menat
71e31a4200 chore: version bump 2023-12-01 10:36:49 +05:30