Commit graph

40644 commits

Author SHA1 Message Date
Ankush Menat
3ff49ec0ad fix: mariadb convert port to string for os.execv 2022-12-20 15:14:38 +05:30
Ankush Menat
db35431b8c fix(postgres): psql with remote databases
If you dont use unix socket psql command doesn't work.
2022-12-20 15:14:38 +05:30
Shariq Ansari
57c2d23422
Merge pull request #19358 from shariquerik/datepicker-arabic-fix
Fixes https://github.com/frappe/frappe/issues/19351
2022-12-20 13:02:58 +05:30
Ankush Menat
89a34159f9
fix: postgres query (#19357)
Double quotes are supposed to be used for table/columns only in
postgres. Mariadb is fine with either.


[skip ci]
2022-12-20 12:50:00 +05:30
Shariq Ansari
cbc869e8fa fix: datepicker not working for arabic language 2022-12-20 12:39:39 +05:30
Ankush Menat
f52869482d chore: dont log 404 as errors 2022-12-20 11:20:50 +05:30
Daizy Modi
d88ef967b9
feat: hook ignore_links_on_delete to skip doctypes on delete (#19347)
* feat: hook `ignore_links_on_delete` to skip doctypes on delete

* fix: helper comment

* fix: helper comment

* test: test case for `ignore_links_on_delete`

* test: fix test case
2022-12-20 11:17:28 +05:30
Ankush Menat
f2e958deeb
Merge pull request #19353 from barredterra/get-print-html
fix: re-introduce html param for attach_print
2022-12-20 11:11:49 +05:30
barredterra
ab95cffae9 fix: re-introduce html param for attach_print
Fix error introced by d64836c1c4
2022-12-19 14:26:15 +01:00
Ankush Menat
ee9bfed4ec
Merge pull request #19029 from gavindsouza/runtime-type-checks-api
feat(whitelisted): Runtime typing hints validation
2022-12-19 15:46:49 +05:30
Ankush Menat
e0688f25a8
chore: pin markupsafe (#19348)
We depend on it for escaping. Currently this works because of indirect
dependencies:

```
λ pipdeptree -p MarkupSafe --reverse
MarkupSafe==2.1.1
  - Jinja2==3.1.2 [requires: MarkupSafe>=2.0]
    - frappe==15.0.0.dev0 [requires: Jinja2~=3.1.2]
  - Werkzeug==2.2.2 [requires: MarkupSafe>=2.1.1]
    - frappe==15.0.0.dev0 [requires: Werkzeug~=2.2.2]
```

[skip ci]
2022-12-19 15:37:28 +05:30
gavin
2c498910ba
Merge branch 'develop' into runtime-type-checks-api 2022-12-19 15:12:06 +05:30
Gavin D'souza
b8da76d483 test(typing-utils): Specify exc type
Co-authored-by: Ankush Menat <ankush@frappe.io>
2022-12-19 15:10:56 +05:30
Gavin D'souza
d66eed129c refactor: validate_argument_types
* Rename API for ease of public use
* Add validation condition parameter
* Move function to utils module instead of frappe namespace
2022-12-19 15:07:03 +05:30
Ankush Menat
a1132075a0
Merge pull request #19326 from resilient-tech/get-latest-fix
perf: reuse `_doc_before_save` in `doc.get_latest`
2022-12-19 12:30:30 +05:30
Ahmed Hasanin
57bc2ebf57
fix(workflow): Remove docstatus field from get_workflow_state_count (#19332)
remove docstatus from get_workflow_state_count as it is not being used
and causes error with postgresql as it requires the selected column
to either appear in the group by clause or an aggregat function


[skip ci]
2022-12-19 11:50:58 +05:30
Sagar Vora
2fd2d426cc
fix: better check of whether doctype is child table (#19329)
* fix: better check of whether doctype is child table

* perf: init `_table_fields` earlier
2022-12-19 11:50:16 +05:30
bosdaring
0d26627c66
build: bump pyyaml (#19331)
* Cython and PyYAML

compatible version for rhel based os

* chore: dont pin cython

Co-authored-by: Ankush Menat <ankush@frappe.io>


[skip ci]
2022-12-19 11:47:03 +05:30
Smit Vora
b2581430ed
fix: allow zero page length in get_list to return complete list (#19322)
* fix: allow zero page length to return complete list

* fix: linting issues

[skip ci]
2022-12-19 11:38:10 +05:30
Ankush Menat
95039a1265
fix: db ssl connection (#19308)
ref: https://pymysql.readthedocs.io/en/latest/modules/connections.html

[skip ci]
2022-12-19 11:21:15 +05:30
Shariq Ansari
80da745cf6
Merge pull request #19327 from resilient-tech/no-share-for-std 2022-12-19 11:07:21 +05:30
Sagar Vora
036574f547 fix: patch to remove share on existing sites 2022-12-17 07:57:02 +00:00
Sagar Vora
1684996e9f fix: dont share with self for standard users 2022-12-17 07:57:02 +00:00
Sagar Vora
9ad9c39d25 test: improve doctype and field naming 2022-12-17 07:56:54 +00:00
Sagar Vora
c453ad2d97 perf: reuse _doc_before_save in doc.get_latest 2022-12-17 07:56:54 +00:00
Sagar Vora
1fbead137c
chore: ignore vuln GHSA-hcpj-qp55-gfph during pip audit (#19328) 2022-12-17 11:51:23 +05:30
Ankush Menat
4f6e62a96e
ci: bump black to latest (#19319)
[skip ci]
2022-12-16 15:14:37 +05:30
Devin Slauenwhite
64ec4276fc
fix: restore missing helpful and not_helpful fields to help article doctype. (#19309)
* fix: restore fields 'helpful' and 'not_helpfull' when removed via 02ddaa5ee7\#diff-3e0e1befb66af4c2ab84c6fe0e996dc602d906817f0b00b6239120af9da9be46

* test: help article is helpful or not helpful

* chore: linter
2022-12-16 12:34:52 +05:30
Sagar Vora
6fe9f9b411
test: remove duplication in test_search 2022-12-16 10:21:50 +05:30
Ankush Menat
8140908f99 style: format
[skip ci]
2022-12-15 21:57:52 +05:30
Mohammad Hussain Nagaria
8f8f506b10
feat: fields for attaching (html) meta tags in web form (#19306) 2022-12-15 21:07:10 +05:30
Ankush Menat
c0e5408659
Merge pull request #19277 from resilient-tech/refactor-sanitize_searchfield
fix: use stricter regex for `sanitize_searchfield`
2022-12-15 17:47:07 +05:30
Ankush Menat
8107781f1c
fix: move filelock imports to functions (#19300) 2022-12-15 15:21:31 +05:30
Gavin D'souza
e3f82f0175 fix: Maintain test_password_strength signature
Add deprecation warning instead of removing params directly
2022-12-15 14:11:44 +05:30
Ankush Menat
9b2283092e test: another test case for index duplication 2022-12-15 14:11:26 +05:30
Gavin D'souza
009936dbac fix: Pass _lang in get_raw_commands API call for Frappe WSGi
Revert unintentional change
2022-12-15 13:47:05 +05:30
Gavin D'souza
06cf18d0aa chore: Add optional typing hints for params with default None 2022-12-15 13:47:05 +05:30
Gavin D'souza
029a1fc902 chore: Remove loose types from fn definitions 2022-12-15 13:47:05 +05:30
Gavin D'souza
d978ed7d06 refactor: Raise FrappeTypeError in case of type mismatches 2022-12-15 13:47:05 +05:30
Gavin D'souza
ec931004ca refactor: transform_parameter_types
Failfast if args and kwargs or annotations don't exist
2022-12-15 13:47:05 +05:30
Gavin D'souza
579aa124e1 fix(type-check): Convert tuple types to Union 2022-12-15 13:47:05 +05:30
Gavin D'souza
299a017081 fix(type-check): Parse and validate arbitrary objects 2022-12-15 13:47:05 +05:30
Gavin D'souza
4fe260e09e refactor: transform_parameter_types
- Switch to Pydantic which is under continuous development and can
  support more types
- Equivalent Pydantic API will try to transform data if possible
- The previous point makes it such that we don't need to explicitly try
  to parse each stringified int in app code since Pydantic can do this
- Drop typeguard since it did not handle 3.10+ native typing definitions
2022-12-15 13:47:05 +05:30
Gavin D'souza
73b0971a26 test: Add tests for typing validations 2022-12-15 13:47:05 +05:30
Gavin D'souza
2327a56abc fix(File): Correct acceptable types in APIs
- Allow str types for start, page_length in page_length API
- Allow str, list[dict] file_list in move_file API
2022-12-15 13:47:05 +05:30
Gavin D'souza
41d6c791f1 fix: Build args dict correctly 2022-12-15 13:47:05 +05:30
Gavin D'souza
8e125f577e fix(type-check): Allow some slack for bool to be int or float 2022-12-15 13:47:05 +05:30
Gavin D'souza
f3250808f0 fix: Use typeguard to handle base hints
Pre process exceptions that Frappe requires and pass the ruleset to
typeguard's check_type API
2022-12-15 13:47:05 +05:30
Gavin D'souza
eb4aa0a1f3 fix(handler): Use signature to fetch doc method structure 2022-12-15 13:47:05 +05:30
Gavin D'souza
cff0567faf fix(print): Check doc permission before checking related info 2022-12-15 13:47:05 +05:30