Commit graph

1469 commits

Author SHA1 Message Date
Raffael Meyer
73f0256aa8
feat: add param letterhead to frappe.get_print (#18989)
* feat: add param letterhead to frappe.get_print
2022-11-24 13:15:24 +05:30
Ankush Menat
c658d8cb1b
fix: ignore unpicklable hooks (#18902)
If any custom app use import statement in hooks.py everything breaks.
Hooks.py while being python file is still only supposed to be used for
configuring.

This PR ignores unpicklable members of hooks.py
2022-11-17 11:50:18 +05:30
Ankush Menat
f34f7030a3 refactor: remove txt param from generate_hash use 2022-11-10 11:56:48 +05:30
Ankush Menat
fcaa16bb21 perf: faster generate_hash 2022-11-10 11:36:40 +05:30
Sagar Vora
764370f3c6
fix: set proper cache key for singles when name is passed as None (#18667)
[skip ci]
2022-10-29 17:34:52 +05:30
Ankush Menat
3ddac5fe92
refactor: accurate translation caching (#18595)
* refactor: rename poorly named functions

* refactor: getting translation from apps

- use generator
- use sane name for cache key
- avoid manual handling of frappe.local state just use cache() interface
2022-10-27 16:28:02 +05:30
Ankush Menat
35ba00a54e
fix: handle isatty correctly (#18277)
sys.stdin can be `None`

[skip ci]
2022-10-03 12:05:55 +05:30
Sagar Vora
d947f9c37a fix: set brackets - walrus doesnt get priority 2022-09-19 17:01:40 +05:30
Sagar Vora
c216cd1500 chore: semantic changes to document caching code
[skip-ci]
2022-09-19 16:53:47 +05:30
Ankush Menat
bcb5fe91aa fix: pickle doc objects directly
This seems to be missed out and causes performance regression in IRL
usage when get_doc is called on cached doc already.
2022-09-19 16:21:20 +05:30
Ankush Menat
abd018773b refactor: drop _allow_dict support
This is not required anymore since we store full doc anyway. Also since
they share same cache key calling get_cached_value and get_cached_doc
can end up doing duplicate / double work.
2022-09-19 16:21:11 +05:30
Sagar Vora
6c6a969d3a perf: simpler, faster meta cache 2022-09-19 16:21:11 +05:30
Ankush Menat
ea7fbb2c10 refactor: remove dead flag db.read_only
This was added in last DB refactor but it does nothing, it was probably
supposed to do something with the connection pool but to best of my
knowledge "read only" is not a property of a connection.

It can be achieved with users who only have read access, that however
isn't implemented anywhere.

Removing this for now.
2022-09-09 17:34:46 +05:30
Ankush Menat
55617b9e86 fix: defer logging during read only mode
Deferred:
- Error log
- view log
- web page view

Disable:
- "_seen" tracking used on list view to highlight unseen docs.
- "seen" on error log.
- dashboard chart last ts caching
2022-09-09 17:34:46 +05:30
Ankush Menat
5beccd8802 feat: allow reads during maintenance_mode
To reduce downtime reading from main db server during maintenance_mode
can be allowed. This lets users browse desk, static sites or any other
pages while ensuring that no writes happen to DB.

refactor: use read replica if available
2022-09-08 18:22:03 +05:30
Ankush Menat
7b3cc322f1
Merge pull request #17891 from ankush/misc_fixes
perf: ~45% faster Desk first response
2022-08-22 11:45:20 +05:30
Ankush Menat
2eec621e95 chore: db.get_all -> get_all
Reduces 1 pointless function call.
Function calls are also not "super cheap" in python.
2022-08-22 11:35:14 +05:30
Ankush Menat
4241f8c8c0 perf: simpler/faster preload header computation
We parse entire response to find preload headers, instead just use
include_style and include_script to include assets directly into preload
headers. This shaves off ~13% overhead in response.
2022-08-21 18:46:58 +05:30
Ankush Menat
d61705f528 perf: use cached docs for system settings 2022-08-16 12:24:42 +05:30
gavin
a14b38cc4e
Merge branch 'develop' into modules-refactor 2022-08-09 16:10:36 +05:30
Sagar Vora
c82b6e758e
Merge pull request #17681 from resilient-tech/fix-child-perm
refactor: improved child table permission check
2022-08-09 10:15:36 +00:00
Sagar Vora
7129d6128f chore: lazier import; improved docstrings 2022-08-09 11:50:15 +05:30
Gavin D'souza
624c308659 Merge branch 'develop' of github.com:frappe/frappe into modules-refactor 2022-08-08 12:27:11 +05:30
Sagar Vora
eb1c9fff68 fix: translate each role 2022-08-02 19:28:33 +05:30
Sagar Vora
74c26ac34d fix: use throw 2022-08-02 19:16:53 +05:30
Sagar Vora
61ec026712 refactor: improve frappe.only_for 2022-08-01 22:10:25 +00:00
Sagar Vora
d6aa17cc14 chore: add deprecation warning everywhere verbose is used 2022-07-31 00:24:21 +05:30
gavin
f40214bca8
fix(get_last_doc): Allow for_update as kwarg only
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-07-22 13:34:04 +05:30
Gavin D'souza
006ebcbede refactor: Use pymysql over mariadb client
This is supposed to be a temporary switch to make the parent PR easier
to digest. MariaDB client has some issues with release, and system
dependencies.

This commit may be reverted to enable mariadb client again.
2022-07-22 12:10:54 +05:30
Gavin D'souza
1ccdad811a Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-07-19 16:23:24 +05:30
Shariq Ansari
a50e0ffa08
refactor: Webform (#17232) 2022-07-19 15:52:15 +05:30
Ankush Menat
0164a87ac9
Merge pull request #17350 from Aradhya-Tripathi/get-all-mod
feat: Adding support to Query engine
2022-07-13 18:36:04 +05:30
Gavin D'souza
71b5c77e6e Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-07-05 14:55:02 +05:30
mergify[bot]
fa3f72fef4
Merge pull request #17289 from surajshetty3416/cleanup-libs
chore: Remove unused libraries/files and update licenses
2022-07-05 05:17:14 +00:00
Ankush Menat
9a5d11234c
fix: validate scheduler, hook method names (#17400)
* chore: warn about missing scheduler / doc events

* fix: pass list instead of filter

filter can only be iterated upon once

* refactor: many typehints in __init__.py
2022-07-04 19:29:16 +05:30
Suraj Shetty
81436dc688 fix: Remove unused function and listener 2022-07-04 14:59:26 +05:30
Aradhya Tripathi
ebd1d5b48c
Merge branch 'develop' into get-all-mod 2022-07-01 13:25:32 +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
Gavin D'souza
fddd624a7c Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-30 14:31:52 +05:30
Ankush Menat
813dcc1848
Revert "feat: Adding support to Query engine" 2022-06-29 23:30:23 +05:30
Gavin D'souza
cf699fe40b Merge branch 'develop' of github.com:frappe/frappe into mariadb-client-refactor 2022-06-29 13:49:18 +05:30
gavin
91e76ff874
Merge branch 'develop' into get-all-mod 2022-06-28 19:47:20 +05:30
Aradhya
7732accded feat: Attached Engine object to qb & added dynamic type hints 2022-06-28 19:43:23 +05:30
gavin
3ddac3ba58
Merge branch 'develop' into mariadb-client-refactor 2022-06-28 18:09:49 +05:30
gavin
bb0283a1cf
Merge branch 'develop' into mariadb-client-refactor 2022-06-28 14:57:21 +05:30
Gavin D'souza
07d7b34fd9 refactor: get_unsubscribe_message
* Add fallback label "Unsubscribe" instead of printing None in the email
* Add typing hints, f-stringify & make code DRY-er for better readability
2022-06-28 12:08:00 +05:30
Ankush Menat
112f113598
fix!: remove dangerous "rollback_on_exception" flag (#17321) 2022-06-27 17:04:34 +05:30
Gavin D'souza
ef078a4ab5 refactor(db-read_only): Track conn type in Database instance 2022-06-23 19:40:17 +05:30
gavin
574f160d3c
Merge branch 'develop' into mariadb-client-refactor 2022-06-23 16:13:03 +05:30
Deepesh Garg
26d0e7a0f9
fix: App logo not set in website settings (#17261)
* fix: App logo not set in website settings

* chore: potential error in system settings
2022-06-21 20:07:59 +05:30