Commit graph

156 commits

Author SHA1 Message Date
Safwan Samsudeen
a5100b18d9 fix: make file size param optional 2026-03-12 13:53:27 +05:30
Safwan
8e681bd568
fix: reset temp file for new uploads (#37922) 2026-03-11 11:50:12 +05:30
Safwan Samsudeen
a1895b0507 fix: remove uploads dir usage 2026-03-10 13:20:40 +05:30
Safwan Samsudeen
05901488d5 feat: add chunking to files 2026-03-10 13:03:07 +05:30
Akhil Narang
3e4f139ff3
fix: use string representation of exceptions in translated strings (#37756)
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2026-03-06 13:02:16 +05:30
Ankush Menat
a16938f455
fix(DX): Throw error when unsupported input is sent (#37438) 2026-02-24 07:01:09 +00:00
Ankush Menat
32d003c981
fix: Allow GIF uploads (#35295) 2025-12-17 08:48:31 +00:00
Akhil Narang
2dcfe07ca8
refactor: make use of check_permission parameter for get_lazy_doc
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-10 16:52:26 +05:30
Akhil Narang
c290cffc27
fix(run_doc_method): check for permissions when calling get_doc
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-09 19:31:26 +05:30
Sagar Vora
9c6594b47c fix: restrict HTTP methods for some public methods 2025-11-21 17:33:20 +05:30
Patrick Eißler
fb783dda08
fix: allow download via API, if at least one file copy is downloadable (#33560) 2025-08-06 18:41:59 +02:00
Ankush Menat
49f582ae57 perf: Use lazy doc in a lot more places 2025-06-11 09:55:45 +05:30
Raffael Meyer
9430e3af86
fix: respect override_whitelisted_method in map_docs (#31718)
* refactor: override_whitelisted_method

* fix: respect `override_whitelisted_method` in `map_docs`

* refactor: override_whitelisted_method
2025-03-17 14:27:12 +01:00
Ankush Menat
8d15d28463
fix: check permission on new doc (#31626)
User might only have "only if creator" permission so checking on doctype
will incorrectly flag it.

Not sure if there's any better/simpler way to handle this. This is weird
edge case on how files operate.
2025-03-10 13:30:13 +00:00
Sagar Vora
f4062b4d7a fix: ensure consistent error in response 2025-02-19 12:10:59 +05:30
Ankush Menat
dfc6dcb6b8 Revert "perf: Avoid checking server script map (#29057)"
This reverts commit 55a55e7f7b.
2025-01-06 19:43:53 +05:30
Ankush Menat
55a55e7f7b
perf: Avoid checking server script map (#29057)
If I have to hazard a guess, 99% API calls are not server scripts, then
why check it first and pay the costs?

This PR first checks if method is a real method in python code and if
it's not found then only attempts to fetch it from server script map.

I'll revert this if I can bring the costs in acceptable limits with
client-side caching.
2025-01-06 07:40:20 +00:00
RitvikSardana
6e524ada8f chore: code cleanup 2024-12-17 13:11:57 +05:30
RitvikSardana
f6637d7ef0 fix: change error message 2024-12-17 13:10:27 +05:30
RitvikSardana
15f64fa7bc fix: add support for CSV files for non desk users 2024-12-17 13:06:21 +05:30
Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
Raffael Meyer
9208b58b6f
refactor: use doc.check_permission (#28317)
* refactor: use `doc.check_permission`

* refactor(delete_doc): check_permission_and_not_submitted
2024-11-22 10:41:24 +01:00
David Arnold
8cfeb156df
devx: add deprecation dumpster (#27887)
* feat: Add deprecation_dumpster.py file

* docs: add jovial and jocose docstring for frappe/deprecation_dumpster.py

* refactor: fill the dumpster with its own kind

* refactor: move to the deprecation dumpster

* chore: color coding class

* fix: only check import error when import errors
2024-10-08 18:56:10 +02:00
David
3a64effe9b
fix: add url to local for custom method to use 2024-10-01 16:21:29 +02:00
Rushabh Mehta
ddee23f5ad fix(ui): sortable sidebar, fixes to breadcrumbs etc 2024-09-06 14:12:36 +05:30
Ankush Menat
16f8d4c107
fix!: drop duplicate uploadfile (#26098)
* fix: deprecate uploadfile

use upload_file

* chore!: Drop deprecated method
2024-04-22 12:45:31 +00:00
Ankush Menat
3c2bf77c81
fix: Avoid permission check on unsaved doc (#26027)
Use case:
- User has "if owner" perm
- Doc isn't created
- We skip doc perm check because doc doesn't exist
- We check if user has write perm to doctype, which isn't available
  because it's only "if owner"

Fix: We can avoid perm check entirely here, files are only re-attached
if doc saves successfully which implies that reference doc was indeed
saved after perm check.
2024-04-18 13:47:39 +05:30
Ankush Menat
3ac30956c9
fix: Check perm for library file before cloning (#25117) 2024-02-27 18:15:20 +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
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
barredterra
09919a3e58 fix: use the correct doc method 2024-01-31 12:55:41 +01:00
Akhil Narang
eb45da3913
feat: Allow usage of print() within safe_exec() (#23084)
* feat(safe_exec): allow usage of `print()`

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

* refactor(system_console): update description to mention `print()` instead of `log()`

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

* feat: unconditionally add debug logs to response if present

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

* chore(safe_exec): add in a test for running `print()` within safe_exec

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

* fix(safe_exec): ignore warning

RestrictedPython warns us if we call `print()` don't use their `printed` variable

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

* feat: store debug logs from scheduled jobs

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

* fix: avoid ignoring warnings, disabled in prod anyway

* chore: remove unnecessary logging

This can be moved to level 2 when required

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-11-20 12:45:41 +05:30
Ankush Menat
66b825c134 chore: deprecate runserverobj 2023-11-01 21:42:05 +05:30
Maharshi Patel
409a3a8105 Merge branch 'develop' into fix-attach-before-doc-save 2023-10-19 11:40:20 +05:30
Ankush Menat
d117e2c08b fix!: Last overriden method should be considered 2023-10-16 18:13:33 +05:30
Ankush Menat
507343f4f6 fix: double response processing 2023-10-16 18:12:53 +05:30
Ankush Menat
c7338f5a83 chore: deprecate form_dict.cmd, globals() 2023-10-16 18:12:53 +05:30
Maharshi Patel
0c9efd3b5a fix: don't overwrite name for library files
name is used in many places and should not be overwritten,
so i have sent name in upload_via_file_browser as library_file_name
which can be used to get existing file.
2023-10-16 12:53:38 +05:30
Maharshi Patel
0439e01ee7 fix: attach file from library
Previously, the attach from library only shared file_url, problem is we
need more information such as is_private.

fix: send name instead of file_url on file uploader and use that in
upload_file handler to get more information about the file then attach
that info to newly created file.
2023-10-16 12:26:39 +05:30
Ankush Menat
cc292d6789 fix!: Last overriden method should be considered
Following same principle of last writer wins everywhere
2023-09-25 16:35:12 +05:30
barredterra
262bda5c91 feat: check write perms on attached to doc(type) 2023-09-21 14:53:45 +02:00
Sagar Vora
023897a35e chore: define ping API only once 2023-08-24 18:05:15 +05:30
Sagar Vora
b395a84d0b
fix!: remove version API (#21786) 2023-07-24 13:01:45 +05:30
Ankush Menat
b66c3d9106
fix: content_type can be None during file upload (#20572)
closes https://github.com/frappe/frappe/issues/20571
2023-04-03 19:49:56 +05:30
Faris Ansari
faae4e7a86
Merge pull request #19433 from netchampfaris/allow-video-files 2022-12-29 16:09:10 +05:30
Faris Ansari
d60acc7cb4 fix: allow video files to be uploaded 2022-12-29 15:40:41 +05:30
Saqib Ansari
296ef1f9bd chore: add methodname to monitor log (#19388) 2022-12-22 14:18:42 +05:30
Gavin D'souza
eb4aa0a1f3 fix(handler): Use signature to fetch doc method structure 2022-12-15 13:47:05 +05:30
Sagar Vora
a9fd5f5001 fix: dont allow blank content of unsupported type 2022-07-11 14:23:10 +05:30
Sagar Vora
e8623dbc19 fix: simplify condition 2022-07-11 14:10:59 +05:30