saxenabhishek
0f75394720
refactor: pythonic NamedParameterWrapper
2022-01-11 01:01:44 +05:30
saxenabhishek
15f3523c24
test: qb parameterization
...
where conditions
set update conditions
where with a function
2022-01-11 01:01:29 +05:30
Gavin D'souza
d81fe8699c
feat: frappe.db.set_single_value
...
Alias to frappe.db.set_value without having to pass the doctype name
twice or teh second one as None
Other changes:
* set/get db APIs for single DocTypes
* Make use of redundant cache key in frappe.db.get_single_value
2022-01-10 21:03:14 +05:30
Gavin D'souza
202145f0ec
test: Add tests for frappe.db.set_value
2022-01-10 21:01:02 +05:30
Gavin D'souza
479f637f76
fix(single:set_value): Cast using sbool instead of str for all
2022-01-10 20:59:50 +05:30
saxenabhishek
f7cb090c5a
style: test_query_builder
2022-01-10 16:09:53 +05:30
Gavin D'souza
3052808048
fix: Don't cast to str if None or Falsy
...
* refactor: use get_single_value instead of set_value(blah, None, blah1)
* User.reload in test_home_page to combat what happens locally
2022-01-10 15:05:57 +05:30
Gavin D'souza
f6fba91fd2
chore(typing): Add type hints in qb builder classes
2022-01-10 13:44:23 +05:30
Gavin D'souza
04e79eb075
fix(qb:ValueWrapper): Use get_value_sql only for str values
2022-01-10 13:25:47 +05:30
Gavin D'souza
5de0b5cd35
style: remove commented code, whitespaces test_file, added typing hint
2022-01-10 13:23:49 +05:30
Gavin D'souza
6aa9a0bef5
style: Sorted imports & whitespace consistency
2022-01-07 20:44:51 +05:30
Gavin D'souza
34a6f7adb5
fix(qb): Patch ParameterizedValueWrapper as wrapper_cls
2022-01-07 20:43:50 +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
123bcc9509
fix: Clear cache on set_value
2022-01-07 14:16:45 +05:30
Gavin D'souza
b0c30363cf
fix: Cast values as str for all single doctypes
...
Re-arranged block for simplicity. Type casting doesn't change anything
it seems. On get_value, values are casted properly.
2022-01-07 11:49:49 +05:30
Gavin D'souza
697d6f2d7a
fix: Run query even if no documents found for_update
...
If no docnames are found, then use NULL as fallback. I tested this on PostgreSQL & MariaDB and it seems to work as expected
In [1]: from frappe.query_builder import Field
In [2]: frappe.db.set_value('ToDo', Field("creation") > Field("modified"), 'description', 'change 2', for_update=True, debug=True)
SELECT "name" FROM "tabToDo" WHERE "creation">"modified"
Execution time: 0.0 sec
UPDATE "tabToDo" SET "description"='change 2',"modified"='2021-10-22 09:38:40.110481',"modified_by"='Administrator' WHERE "name" IN (NULL)
Execution time: 0.0 sec
2022-01-07 11:47:49 +05:30
Gavin D'souza
aefb8e3b06
fix: Expand iterable to get rid of extra brackets
...
Although valid SQL, MariaDB didn't like double brackets on VALUES. It
raised ERROR 1241: Operand should contain 1 column(s)
2022-01-07 11:46:56 +05:30
Gavin D'souza
44f603fc6e
refactor: frappe.db.set_value
...
* Simplified logic
* Perf enhancements (removed unnecessary conditional computations)
* Use query builder and ORM to build queries instead of juggling
2022-01-07 11:45:27 +05:30
Suraj Shetty
b64cab6867
Merge pull request #15543 from alyf-de/white-space-unset
2022-01-07 11:16:58 +05:30
Suraj Shetty
d52f12424a
Merge branch 'develop' into custom_translations
2022-01-07 09:45:14 +05:30
mergify[bot]
2aa062720a
Merge pull request #14978 from hrwX/multistep_webforms
...
feat: Multistep webforms
2022-01-06 15:15:32 +00:00
barredterra
ea5695700c
feat: add german translations for datatable menu
2022-01-06 15:52:05 +01:00
Raffael Meyer
f04be3f876
fix: sider
2022-01-06 15:44:29 +01:00
Suraj Shetty
f930fd0fe1
Merge branch 'develop' into multistep_webforms
2022-01-06 18:31:37 +05:30
Suraj Shetty
335eafe0ba
Merge branch 'develop' into single-card-form-fix
2022-01-06 18:30:25 +05:30
Suraj Shetty
2c6f8f04c3
Merge pull request #15502 from surajshetty3416/fix-datetime-filter
2022-01-06 18:29:55 +05:30
Shariq Ansari
3f476fc17c
Merge branch 'develop' into single-card-form-fix
2022-01-06 16:23:20 +05:30
Shariq Ansari
080b3b889f
fix: border color fix in dark mode
2022-01-06 16:08:10 +05:30
hrwx
c8c77437fa
feat: add translations to datatable
2022-01-06 13:00:16 +05:30
gavin
8319363d61
Merge pull request #15542 from gavindsouza/frappeclient-redirect
...
fix: FrappeClient post_api request being redirected to GET request
2022-01-06 12:01:50 +05:30
harshpwctech
997c0e25cb
Updating the get_payment_gateway_url method ( #15423 )
...
This change is proposed as on_payment_authorized method defined in any doctype for which the payment is made isn't getting triggered.
https://github.com/frappe/frappe/pull/12756
2022-01-06 05:54:58 +00:00
mergify[bot]
ea5d99b0e9
Merge pull request #15484 from MochaTechnologies/migrate-new-column-index
...
fix(Migrate): add unique and index for new columns
2022-01-06 05:54:18 +00:00
mergify[bot]
9c8a3003b9
Merge pull request #15468 from pateljannat/time-zone-info-in-web-form
...
fix: Time zone info in web form
2022-01-06 05:52:16 +00:00
Suraj Shetty
a051f796cc
Merge branch 'develop' into multistep_webforms
2022-01-06 11:06:28 +05:30
Suraj Shetty
1d11ff0375
Merge branch 'develop' into fix-datetime-filter
2022-01-06 11:06:02 +05:30
barredterra
bf28199a6d
fix: awesomeplete line wrapping
2022-01-05 18:14:54 +01:00
Gavin D'souza
984420363a
fix: Use params instead of data for client login
2022-01-05 20:38:16 +05:30
Navdeep
d73428df91
feat(fixes): for frappeclient post_api(POST) request being redirected to GET request on calling server
2022-01-05 20:35:31 +05:30
mergify[bot]
77fd08985a
Merge pull request #15533 from nextchamp-saqib/fix-frt-test
...
fix: set `first_response_time` only if communication is sent
2022-01-05 11:11:16 +00:00
mergify[bot]
50adb122b2
Merge pull request #15517 from supergicko/fix/ldap-settings-tls-protocol
...
fix(ldap): Auto-negotiate the highest TLS protocol version supported by client & server
2022-01-05 10:50:54 +00:00
Suraj Shetty
5d5ad78789
refactor: Rename week_starts_on to first_day_of_the_week
...
For consistency
2022-01-05 14:54:46 +05:30
Saqib Ansari
ae5644c3e1
fix: set first_response_time only if communication is sent
2022-01-05 14:23:44 +05:30
mergify[bot]
96a45473ab
Merge pull request #15492 from resilient-tech/fix-clear-cache-in-set-value
...
fix: clear cache for all docs matched with the filters passed as `dn` param in `set_value`
2022-01-05 07:06:07 +00:00
Ankush Menat
80d456ef7e
fix: avoid cached results for table_exists during install
2022-01-05 11:54:46 +05:30
Christoph Kappel
c99e576e1b
fix: offer all (also modern) supported tls versions (PROTOCOL_TLS_CLIENT [1]) to LDAP endpoints instead of only (deprecated) PROTOCOL_TLSv1 [2]
...
Background: Currently, when connecting to a ldap backend, ssl.PROTOCOL_TLSv1 [2] is offered as only option to the backend.
This leads to following issues:
- LDAP Backends that do not support TLSv1.0 (because of security reasons [3]) cannot be used in ERPNext
- erpnext can ONLY connect to LDAP Backends offering the insecure [3] TLSv1.0 protocol (see ldap_settings.py ln: 61, 63)
With this change to ssl.PROTOCOL_TLS_CLIENT we allow erpnext customers to configure LDAP Backends that also support more modern/secure (TLSv1.2 and up) transport
while still ensure backwards compatibility and allowing TLSv1.0,
since ssl.PROTOCOL_TLS "Auto-negotiates the highest protocol version that both the client and server support" [1]
[1]: https://docs.python.org/3/library/ssl.html#ssl.PROTOCOL_TLS_CLIENT
[2]: https://docs.python.org/3/library/ssl.html#ssl.PROTOCOL_TLSv1
[3]: https://tools.ietf.org/id/draft-ietf-tls-oldversions-deprecate-02.html
2022-01-04 16:52:55 +01:00
Suraj Shetty
f6d0697309
test: Fix test_assign
2022-01-04 19:54:41 +05:30
Gavin D'souza
6e4aa52e2e
fix: Show assignments correctly for Forms
2022-01-04 19:20:03 +05:30
Gavin D'souza
1b57717058
fix: Return key name as owner for consistency
2022-01-04 18:58:17 +05:30
Gavin D'souza
dc2a99b8d6
refactor(minor): Use pluck instead of re-iteration
2022-01-04 18:57:49 +05:30
Faris Ansari
c1995226d7
Merge pull request #15526 from netchampfaris/blog-category-load-more
...
fix(blog): Load more with category filter
2022-01-04 17:34:23 +05:30