Commit graph

1521 commits

Author SHA1 Message Date
Sagar Vora
d2dfc8c335 fix: define __slots__ to avoid __dict__ creation 2022-04-13 11:19:20 +05:30
Sagar Vora
594e653347 refactor: improved frappe._dict 2022-04-13 11:19:19 +05:30
Gavin D'souza
97e911e069 Merge branch 'develop' of github.com:frappe/frappe into refactor-file 2022-04-13 10:49:26 +05:30
Ankush Menat
da5a5eda02
fix: incorrect type in make_property_setter query (#16584)
* fix: incorrect type in make_property_setter query

* fix: Remove redundant as_list kwarg

Co-authored-by: gavin <gavin18d@gmail.com>
2022-04-12 12:00:11 +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
Abhishek Saxena
5c8856d66e
refactor: db.sql calls to frappe.qb (#16107)
# Changes

- Introduces `subqry` class to use in where clause when there is a non-column condition. eg.
> .where(subqry(no_of_roles) == 0)
- Convert SQL queries to frappe.qb 

# Testing

Functions with query refactors
- frappe.boot.get_user_pages_or_reports() -> Same output of `get_bootinfo()` as develop
- frappe.boot.get_unseen_notes() -> Forms the same query as develop 
```sql
SELECT `name`,`title`,`content`,`notify_on_every_login`
FROM `tabNote` WHERE `notify_on_every_login`=1
AND `expire_notification_on`>'2022-03-30 01:10:53.393874'
AND (SELECT `nsb`.`user` FROM `tabNote Seen By` `nsb` WHERE `nsb`.`parent`=`tabNote`.`name`) NOT IN ('Administrator')
```
- frappe.installer._delete_doctypes() -> installed and uninsalled a dummy app to drop tables

### Not tested
- frappe.make_property_setter()
- frappe.realtime.get_pending_tasks_for_doc() [whitelist method]
- frappe.sessions.Session.start()
- frappe.twofactor.cache_2fa_data()
2022-04-12 05:07:25 +00:00
Sagar Vora
2775364afd perf: 90% faster get_cached_value from Redis cache 2022-04-01 13:45:21 +05:30
Sagar Vora
6993f51bf9 fix: ignore DoesNotExistError inside get_cached_value 2022-03-30 15:40:09 +05:30
gavin
bc7cf8beff
Merge pull request #16322 from gavindsouza/as_json-handler
fix(as_json): sort keys always (even when not valid JSON)
2022-03-28 12:34:02 +05:30
Gavin D'souza
47cf46cd49 Merge branch 'develop' of github.com:frappe/frappe into refactor-file 2022-03-24 21:38:21 +05:30
Gavin D'souza
60ef536393 fix: Strip HTML tags in traceback shown in the terminal 2022-03-24 19:31:02 +05:30
leoajr
a9b8fe8197
docs: incorrect argname in docs for get_list #16384 2022-03-23 18:29:39 +05:30
Suraj Shetty
cd8bd4ccf0
Merge pull request #16278 from surajshetty3416/is-system-generated-customization 2022-03-23 10:52:21 +05:30
Gavin D'souza
448fb8a207 Merge branch 'develop' of github.com:frappe/frappe into bg-rename_doc 2022-03-22 12:29:43 +05:30
mergify[bot]
aa42efe1de
Merge pull request #16363 from alyf-de/fullargspec
refactor: call getfullargspec only once
2022-03-22 06:24:28 +00:00
barredterra
8cf2bf8953 refactor: call getfullargspec only once 2022-03-21 23:09:58 +01:00
barredterra
179c9f117c perf: exists is already called in delete_doc 2022-03-21 21:12:05 +01:00
Gavin D'souza
1c8d2fd536 fix: Sort keys for illegal JSON 2022-03-21 17:49:26 +05:30
Gavin D'souza
4f1d00442c fix(as_json): Pop None key if exists
JSON doesn't allow null key as per spec, it should be a string only: https://datatracker.ietf.org/doc/html/rfc7159#section-4

ref discussions:
* https://github.com/frappe/frappe/issues/14292
* https://github.com/frappe/frappe/pull/14504/files#r821526085
2022-03-17 17:39:27 +05:30
Suraj Shetty
127b5477e1
Merge branch 'develop' into is-system-generated-customization 2022-03-17 14:09:11 +05:30
Rushabh Mehta
dd02496dad
Merge pull request #15964 from phot0n/integer-primary-keys
feat: integer primary keys
2022-03-16 17:07:20 +05:30
Sagar Vora
a2b02f9f33 fix: more succinct docstring 2022-03-14 15:59:32 +05:30
Sagar Vora
290628ba3f style: use inline if 2022-03-13 15:02:24 +05:30
Sagar Vora
dc4d07cb61 style: use walrus operator 2022-03-13 12:54:04 +05:30
Sagar Vora
f6c546159c perf: cache single documents 2022-03-12 00:10:36 +05:30
phot0n
b876520ef0 fix: logic for is_autoincremented 2022-03-11 23:46:00 +05:30
phot0n
bebc8058b6 feat: integer primary keys 2022-03-11 23:46:00 +05:30
Gavin D'souza
9e36005c70 fix: Remove taken file locks at end of background job 2022-03-03 20:05:05 +05:30
Suraj Shetty
c51a581e2c feat: Set is_system_generated as false if customization is created via Customize Form 2022-03-01 09:20:47 +05:30
Raffael Meyer
4750ff69e6
Merge branch 'develop' into msgprint-title-backend 2022-02-09 10:34:05 +01:00
Gavin D'souza
5b6ceb5543 Merge branch 'develop' of github.com:frappe/frappe into set_value-refactor 2022-01-28 18:39:12 +05:30
barredterra
aba467307f fix: translate default msgprint title in backend 2022-01-27 20:14:51 +01:00
barredterra
dac9349aef refactor: use is bool instead of == bool 2022-01-17 15:40:33 +01:00
Gavin D'souza
429f839ea3 style: Add typing, sorted imports# 2022-01-17 15:31:37 +05:30
barredterra
b1383df15a refactor: use is None instead of == None 2022-01-17 10:37:51 +01:00
Gavin D'souza
227dc26707 Merge branch 'develop' of github.com:frappe/frappe into set_value-refactor 2022-01-17 14:04:13 +05:30
Rushabh Mehta
853287f49d fix: load user_info on-demand 2022-01-13 16:39:24 +05:30
Gavin D'souza
31cc658e6d fix(typing): Add type hints for frappe.cache 2022-01-07 14:17:28 +05:30
Gavin D'souza
84ebdabe49 refactor(minor): frappe.has_permission
The throw block was very clearly broken. Referencing frappe.throw inside
__init__.py rip. Added drop in replacement msgprint call
2021-12-24 13:59:57 +05:30
phot0n
1d879f741b feat: before_uninstall and after_uninstall hooks 2021-12-20 14:05:10 +05:30
Aradhya
69108c4c86 Merge branch 'develop' of github.com:Aradhya-Tripathi/frappe into at/aggregations 2021-11-27 17:52:30 +05:30
mergify[bot]
55103a92e6
Merge pull request #14987 from Aradhya-Tripathi/at/queries
refactor: moving raw queries to frappe ORM
2021-11-26 16:20:04 +00:00
Aradhya
e3bdf11006 refactor: moved aggregation functions to Query Builder 2021-11-26 14:19:59 +05:30
Aradhya
9ccf467acb fix: fixed no order arg in converted queries 2021-11-23 13:30:42 +05:30
mergify[bot]
17aa4b823b
Merge pull request #14577 from Alchez/dev-granular-printing
feat: allow more print page size options (develop)
2021-11-22 10:39:10 +00:00
Aradhya
1bdff9f3bd refactor: converted queries in init 2021-11-20 21:33:03 +05:30
codescientist703
ed13182573 chore: Remove Chat Module 2021-11-09 13:44:57 +05:30
Suraj Shetty
31d5d81e31
revert: "chore: Remove chat module" (#14922) 2021-11-09 10:30:00 +05:30
Rushabh Mehta
da6b86ef4f
Merge pull request #14411 from codescientist703/remove-chat
chore: Remove chat module
2021-11-09 09:54:22 +05:30
mergify[bot]
b3bc419a11
fix: for frappe._dict deepcopy; Opened issue 14833 (#14889) (#14914)
* fix: DFP "__deepcopy__" exception" within _dict __getattr__

* fix: for frappe._dict deepcopy; Opened issue 14833 #14889 (accepted gavindsouza suggestion)

Co-authored-by: gavin <gavin18d@gmail.com>

* fix: for frappe._dict deepcopy; Opened issue 14833 #14889 (accepted gavindsouza suggestion)

Co-authored-by: gavin <gavin18d@gmail.com>

Co-authored-by: gavin <gavin18d@gmail.com>
(cherry picked from commit db6996a763ec2ffd85470d991f860192e87ca7e3)

Co-authored-by: Development for People <47140294+developmentforpeople@users.noreply.github.com>
2021-11-08 11:18:55 +01:00