Commit graph

88 commits

Author SHA1 Message Date
Ankush Menat
35667e758d fix: Implement backpressure for background jobs 2025-03-05 10:59:00 +05:30
Sagar Vora
f4062b4d7a fix: ensure consistent error in response 2025-02-19 12:10:59 +05:30
Ankush Menat
11a6dfb6a0
revert: bencher/bench intrface (#28925) 2024-12-26 14:41:36 +00:00
David Arnold
fef569e284
refactor: simplify bencher (#28694)
* chore: flatten bencher class layout

* chore: rename bencher to clarify

* docs: add file level docstrings
2024-12-07 14:10:03 +00:00
David Arnold
3d71f594d8
refactor: bench class inauguration (#28158)
* feat: Add bench layout classes and configuration handler

Bench layout: (`frappe.bench`)

- Layout by env variable, e.g. FRAPPE_BENCH_PATH, FRAPPE_SITES_PATH, etc
- Detecting modules and apps by the presence of a sentinel .frappe file
- Site is scoped by frappe.local.site_name (thread safe)

Config handler: (`frappe.bench.sites{,.site}.config`)

- Optional config registry for better discovery; warning if not specced
- Env variable overload with `FRAPPE_` prefix

* chore: type frappe.config

* chore: type frappe.bencher

* chore: py310 compat
2024-12-06 19:07:34 +01:00
David
1c4a0fe54f
feat: add read only document mode 2024-10-02 12:02:52 +02:00
Akhil Narang
803b45b9fa
feat: ignore tar: file changed as we read it during backups
This seems to occur when new files are being created as we're archiving
the files on a site. Doesn't make sense to fail the entire backup
because of that.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-05-17 11:39:41 +05:30
Ankush Menat
ea45d959b3 fix: correct HTTP response code for rate limit 2024-04-08 18:24:38 +05:30
Akhil Narang
44667901bf
feat: allow setting a custom http status code for redirects
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-20 17:36:42 +05:30
Ankush Menat
a2b2998684
fix(DX): Wrap print format errors (#21944)
[skip ci]
2023-08-06 18:55:16 +05:30
David Arnold
2ccab0d625
fix: checkpoint the supported schemes for connectivity (#21576)
* fix: checkpoint the supported schemes for connectivity

This PR implements a gateway + error that clearly hints the operator at
a misconfigured system during runtime.

Particularity, against the multiple library-provided ways of configuring
redis connection strings (in python), this hard stops if an unsupported
one is chosen by accident.

* fix: remove unknown protocol

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-07-15 11:05:29 +05:30
Ankush Menat
86b9ff4266 feat: Allow specifying rounding method in flt 2023-03-08 10:59:02 +05:30
Ankush Menat
8409caef6f fix: show proper error with traceback when boot fails 2023-02-20 18:33:49 +05:30
Gavin D'souza
d978ed7d06 refactor: Raise FrappeTypeError in case of type mismatches 2022-12-15 13:47:05 +05:30
Ankush Menat
f96505fae0 feat: wrap read only mode SQL errors 2022-09-09 17:34:44 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Suraj Shetty
a4d7cfdd24 fix: Update exception message 2022-06-01 19:53:57 +05:30
Suraj Shetty
8f7d8bf1ff refactor: Update exception names 2022-06-01 17:59:19 +05:30
Suraj Shetty
af287a04a9 refactor: Remove unnecessary exception handling 2022-06-01 17:50:07 +05:30
Suraj Shetty
0d10624ce5 Merge branch 'develop' of https://github.com/frappe/frappe into fix-document-signature 2022-05-05 14:20:29 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
saxenabhishek
c53e6d822d feat: parse app name from tags and urls 2022-03-22 14:16:59 +05:30
Suraj Shetty
e0e12d43f1 Merge branch 'develop' of https://github.com/frappe/frappe into fix-document-signature 2022-02-07 13:26:57 +05:30
Saqib Ansari
bd8ac90286
fix(ux): show report button on too many writes error (#15614)
* feat: log errors on too many writes to ease debugging

* fix(ux): extract and show which app/file/function caused too many writes

* fix: postgres error checking assumes exception is postgres exception

* fix: better default for skipping frames

Typically stack is like: some_app -> your_function -> this function. So last 2 frames need to be skipped.

* fix: postgres error checking assumes exception is postgres exception

* fix: better default for skipping frames

Typically stack is like: some_app -> your_function -> this function. So last 2 frames need to be skipped.

* refactor: show Report button instead of logging

* revert: unnecessary new functionality

* test: assert exact exception

Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-01-31 18:57:32 +05:30
Suraj Shetty
4aab56edfc refactor: Permission validation for print view
- Show UI based on the status of the key/permission
- Respond with proper http_code according to the permission validation
2022-01-19 12:38:37 +05:30
Suraj Shetty
64985a5d1a feat: Document key expiry 2021-12-28 15:19:01 +05:30
Saqib Ansari
4670207dbd refactor: extend Exception instead of ValidationError 2021-10-25 18:46:54 +05:30
Saqib
0cdbde3f3f
Merge branch 'develop' into mask-sql-errors 2021-10-20 15:46:45 +05:30
Saqib Ansari
3b4530ef5d fix: prevent report error for AttachmentLimitReached exceptions 2021-10-20 10:38:30 +05:30
Saqib
b11c99137c
chore: rename exceptions 2021-10-19 18:01:18 +05:30
Saqib Ansari
e205acae3c feat: handle timeout and deadlocks in db.sql 2021-09-28 13:14:26 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
eca30667d2 chore: Drop FileNotFoundError handling for PY2 2021-05-26 22:21:23 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Suraj Shetty
71dd300ae3
fix: Raise PageDoesNotExistError instead of DoesNotExistError (#12485)
- to avoid it getting mixed up with Document Not Found error
2021-02-26 12:59:42 +05:30
Suraj Shetty
a05ea1eea6
Merge branch 'develop' into maximum-attachment-limit-validation-develop 2020-11-18 15:54:37 +05:30
Gavin D'souza
39da1e0363 fix: Raise error if executable not found in PATH 2020-11-17 18:44:34 +05:30
Suraj Shetty
b33461bb53 feat: Add server-side validation for attachment limit 2020-11-17 13:49:10 +05:30
mergify[bot]
c0aae3e28e
Merge pull request #11878 from gavindsouza/validate-backup-before-restore
feat: Validate sql file before restoring site
2020-11-09 12:01:33 +00:00
Gavin D'souza
94d1759041 feat: Validate sql file before restoring site 2020-11-05 13:46:12 +05:30
Deepesh Garg
dbd8f52e54 feat: Non negative check for Int, Float and Currency fields 2020-10-29 16:40:38 +05:30
Gavin D'souza
b0b53e03f6 feat: Add Bulk restore API 2020-07-23 19:01:18 +05:30
Suraj Shetty
d8810e5cff
Merge branch 'develop' into no-ammend 2020-06-10 12:19:54 +05:30
Gavin D'souza
a86ae948f7 fix(commands): raise SiteNotSpecifiedError if site not found in context 2020-05-18 13:01:33 +05:30
Shivam Mishra
e4729b0000 feat: added FileAlreadyAttachedException 2020-05-16 13:29:44 +05:30
Aditya Hase
19e8008c3c feat(rate-limiter): Ignore requests above limit 2020-05-13 12:34:07 +05:30
Chinmay D. Pai
1dfa8ccbc4
feat: add name validation to data fieldtype
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-04-21 15:49:55 +05:30
prafful1234
e19b712e23
fix(api): Fix api for user oauth validations (#9676)
* fix(api): Fix api for user oauth validations

* fix: add auth exceptions + format functions

* fix: Moved exceptions and a validation check

* Fix: Reqested changes

Co-authored-by: prafful1234 <prafful@mntechnique.com>
Co-authored-by: Rohan Bansal <rohan@digithinkit.com>
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-04-11 10:27:00 +05:30
Gavin D'souza
80c4167a07 feat: server validations for data field options 2020-03-25 15:23:36 +05:30
gavin
f3b1846901 fix: added FileNotFoundError compatability (#8342) 2019-09-05 13:17:40 +05:30