Commit graph

3772 commits

Author SHA1 Message Date
Akhil Narang
c0c0cae78a
fix(nestedset): clear user permissions cache when a new doc is created, if applicable
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-08-13 12:54:00 +05:30
Ejaaz Khan
50ff20a12a refactor: only replace month for compatibility 2025-08-06 11:11:24 +05:30
Ejaaz Khan
6cde9a4bcc refactor: fetch time format dynamic 2025-08-05 17:30:14 +05:30
Ejaaz Khan
0e880ac318 feat: format date and datetime fields on export 2025-08-05 17:07:47 +05:30
Akhil Narang
9a94e73489
feat: add in support for _inplacevar_ (#31921)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-08-01 13:50:43 +05:30
Akhil Narang
3c4dc61b7a
Merge pull request #33437 from vehbiu/develop
fix(utils): convert phone numbers passed into validate_phone_number to strings
2025-07-28 15:43:37 +05:30
Raffael Meyer
4983c3fc34
fix: prevent logout due to empty "Password" field (#29158)
* fix: prevent logout due to empty "Password" field

* fix: validate_api_key_secret

- We don't want get decrypted password to raise a ValidationError
- If api_key, api_secret or doc_secret are empty, we want an AuthenticationError
2025-07-28 10:04:10 +05:30
Vehbi Unal
c6a2e6595a fix(utils): convert phone numbers passed into validate_phone_number to strings 2025-07-24 13:02:55 +00:00
Raffael Meyer
93b4700899
fix: make labels in error message translatable (#33166) 2025-07-23 18:11:51 +05:30
Kitti U. @ Ecosoft
74683428cf
feat: Add hook on print pdf (#33387) 2025-07-23 10:45:39 +05:30
Venkatesh M
96e0f49df4 fix: handle None session.data in maintenance mode (fixes #33258)
- Add null check for session.data in safe_exec.py
- Add null check for session.data in base_template_page.py
- Prevents AttributeError when session.data is None during maintenance mode
2025-07-19 16:02:57 +00:00
Ankush Menat
b94b6ec939 perf!: Compute safe exceptions only once 2025-07-19 19:29:27 +05:30
Ankush Menat
38365beb52 perf: Compute safe utils only once
300us -> 60us for this silly change LOL!
2025-07-19 18:49:24 +05:30
Ankush Menat
17a1244585 perf: Always use cached config for checking safe_exec
It expires in 1min anyway
2025-07-19 18:14:04 +05:30
Ankush Menat
bddc89544d perf: Cache safe_exec compilation 2025-07-19 18:04:29 +05:30
Ankush Menat
afb720e003
refactor: move stuff away from init.py (#33283)
* chore: Drop unused imports

* refactor: split translation utils from init.py

* refactor: move sendmail from init.py

* refactor: move prints to attach_print
2025-07-11 07:18:16 +00:00
Sagar Vora
e14218a671 refactor: simplify prepared_args creation, use prepared union type 2025-07-03 18:14:09 +05:30
Sagar Vora
9634fa58b0 refactor: define annotations earlier 2025-07-03 18:08:48 +05:30
Sagar Vora
f922af8001 refactor: avoid using callable as default 2025-07-03 17:30:30 +05:30
Sagar Vora
db246c0aa2 refactor: use global imports 2025-07-03 17:29:31 +05:30
Sagar Vora
fa7e9ebb75 chore: simplify TypeAdapter 2025-07-03 16:14:00 +05:30
Soham Kulkarni
0e46eb6228
fix: handle fraction units being zero (#33137)
* fix: handle fraction units being zero

* Revert "fix: handle fraction units being zero"

This reverts commit 912a031b16fb1e1951093d5b384976f4dc2968e6.

* fix: remove bad fallbacks from money_in_words

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2025-07-01 11:56:42 +05:30
Soham Kulkarni
e1aa789acf
Merge pull request #32971 from sokumon/newsletter-removal
refactor: seperate newsletter into app
2025-06-27 11:59:02 +05:30
Sagar Vora
2e5c8bea03 feat: frappe.utils.orjson_dumps 2025-06-26 17:37:51 +05:30
Sagar Vora
cda7699187 perf: use orjson in utils 2025-06-26 17:37:51 +05:30
Sagar Vora
b857a4099a perf: use orjson for faster request processing 2025-06-26 17:37:51 +05:30
sokumon
2b8d21d483 fix: add utm utils back 2025-06-24 18:43:28 +05:30
Sagar Vora
ae78eb5458 chore: remove old unused cache 2025-06-24 16:52:46 +05:30
Faris Ansari
d584b8691d
Merge pull request #32381 from netchampfaris/api-v2-fixes
feat!: Apply permissions in frappe.qb.get_query

Enhancements:
- Supports applying permissions
- Strict input parsing

BREAKING CHANGE:
```py
# Before
frappe.qb.get_query("Task", fields=["sum(is_completed) as count"])

# After
frappe.qb.get_query("Task", fields=[{"SUM": "is_completed", "as": "count"}])
```
2025-06-23 15:50:25 +05:30
Ankush Menat
18ecd6603b
perf: ~2x faster scheduling (#33027)
* perf: Use cached settings

* perf: Cache parsed crons, ~2x faster scheduling
2025-06-20 12:43:22 +00:00
Ankush Menat
b57eb60486
perf: chain db transactions (#33004)
* perf: chain transactions

Frequently used rollback/commits can be modified to chain previous
transaction.

This reduces one query to DB in most requests.

* perf: chain transactions in requests
2025-06-19 12:37:39 +05:30
sokumon
6be013804d fix: remove tests utils and workspace card 2025-06-18 16:23:36 +05:30
Faris Ansari
56c3a55665 fix: print traceback instead of errprint 2025-06-18 15:56:11 +05:30
Faris Ansari
fc86f9737b fix: print error traceback in api/v2 2025-06-18 15:51:13 +05:30
Akhil Narang
865e086bd4
build: bump dependencies (#32975)
* build(deps): bump babel

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump filelock

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump GitPython

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump Jinja2

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump Pillow

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump PyJWT

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump pypdf

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump pydyf

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump werkzeug

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump bs4

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump bleach

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump chardet

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump croniter

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump cryptography

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump pyopenssl

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump cssutils

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump markdown2

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump markupsafe

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump num2words

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump openpyxl

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump phonenumbers

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump psutil

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump pydantic

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump pyotp

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump dateutil

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump ipython

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump pytz

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump hiredis

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump requests-oauthlib

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump requests

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump rsa

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump sql_metadata

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump tenacity

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump traceback-with-variables

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump tomli

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump uuid-utils

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump xlrd

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump zxcvbn

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump markdownify

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump google libraries

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump posthog

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* build(deps): bump vobject

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* fix(zxcvbn): set max password length as 128

We allow checking till 128 characters, v4.5.0 has a default max of 72

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-06-18 12:33:36 +05:30
Ankush Menat
6091040e97
fix: Skip redis cache signal if redis is down (#32967)
https://github.com/frappe/frappe/pull/32888#issuecomment-2975345660
2025-06-17 13:59:31 +00:00
Sagar Vora
b3e1eda4c8
feat: global frappe.in_test flag (#32960)
* feat: global `frappe.in_test` flag

* feat: helper utility to toggle `frappe.in_test`

* fix: use `toggle_test_mode` util

* fix: use `frappe.in_test`

* chore: add comment explaining global `in_test`

* chore: ignore commit replacing flag usage

* test: temporarily disable `frappe.in_test`

this worked earlier because flag was set in werkzeug.local which was separate for API test client

* test: add comment explaining change
2025-06-17 19:19:31 +05:30
Sagar Vora
cb0d06455b chore: use frappe._dev_server instead of local.dev_server 2025-06-17 12:03:08 +05:30
Ejaaz Khan
9720dd8141 Merge branch 'develop' into timeline_format 2025-06-11 17:11:49 +05:30
Ankush Menat
3167e03133 fix: invalidate persistent caches 2025-06-11 00:28:38 +05:30
Ankush Menat
12ab20f705 fix: Change local variable name
Shouldn't be same as function name
2025-06-10 23:52:27 +05:30
Ankush Menat
e4bc7f361b
Revert: DocRef (#32866)
- Hardly used anywhere
- Too many hardcoded `__value__` calls without which it's not usable.
- Another type to worry about
2025-06-10 05:20:56 +00:00
Vengadesh27
b2059545f4
Merge branch 'develop' into timeline_format 2025-06-06 20:55:11 +05:30
Ankush Menat
a278ff2356 chore: remove invalid return type 2025-06-05 21:38:14 +05:30
Ankush Menat
47a47a9b5d refactor!: Change internal datastructure of db.value_cache
It's now a defaultdictionary of `[doctype][name/filters][fieldname]`

This allows us to implement granular clearing and improve usage of this cache.
2025-06-05 14:46:03 +05:30
Ankush Menat
051aba3049
fix(DX): Fix type annotations for custom cached_property (#32785)
+ Avoid custom implementation on newer python versions entirely.
2025-06-04 16:37:35 +00:00
rohitwaghchaure
5c6b2b5bec
refactor: track completed app setup wizards and re-run the setup wizard upon new app installation. (#32640) 2025-06-03 12:36:22 +05:30
Ankush Menat
fd29e9c464
fix: Smaller batch size for global search (#32720)
10K is quite large for a single batch.
2025-05-29 17:13:01 +00:00
Ankush Menat
03713cfd80
perf: faster time parsing (#32701)
Same as previous date and datetime improvement, this uses C parser
instead of python `parser`.
2025-05-28 15:56:34 +05:30
Vengadesh
4659ee2a00 chore: rename field 'show_absolute_datetime_format' to 'show_absolute_datetime_in_timeline' 2025-05-27 22:19:02 +05:30