Commit graph

815 commits

Author SHA1 Message Date
Suraj Shetty
d4166dbe20 refactor: Replace html2text with markdownify 2022-07-06 08:23:14 +05:30
Ankush Menat
261fbfcd11
Revert "fix(doc)!: Always cast datetime, date and time fields"
Revert "fix(doc)!: Always cast datetime, date and time fields (#15891)"

This reverts commit d7789ab6ff.
2022-07-05 13:43:32 +05:30
Himanshu
d7789ab6ff
fix(doc)!: Always cast datetime, date and time fields (#15891)
### BREAKING CHANGE
#### Datetime, Date and Time fields will always be cast to respective objects in `setattr`, this will ensure uniformity while accessing the values, no more `getdate`, `get_datetime`, `to_timedelta` wrapper.
- While importing data, the framework does check for `set_only_once`.
- In normal case scenarios, this will work flawlessly since most date fields might not be set_only_once.
- But in Subscription, the date field is set to `set_only_once` and in `after_insert`, `document.save` is called, and while doing so, `set_only_once` is checked [here](1944a547f9/frappe/model/document.py (L566)).
-This works fine if the data imported is in the correct format.
- If the date's data is not in the correct format, the framework throws an error.
- for eg `06-02-2022 00:00:00 != 06-02-2022`
- fixes [Issue/#15370](https://github.com/frappe/frappe/issues/15370)

> no-docs
2022-07-05 07:07:16 +00:00
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
96b3ee4dc3 fix(webhook): Unbound 'r' through request timeout
Errors like `requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='httpbin.org', port=443): Read timed out. (read timeout=5)`

ref: https://github.com/frappe/frappe/runs/7126891200?check_suite_focus=true
2022-06-30 13:36:08 +05:30
Ankush Menat
d35d7ffbe2 fix: remove bare exception catching
A bare except catches lots of things (like generator iteration end) and should never be used.
2022-06-28 18:05:00 +05:30
Gavin D'souza
80b19a6031 fix: Cast singles_dict' values
This is to adapt with the changes made in frappe.db.get_singles_dict in
the previous commit
2022-06-15 10:40:26 +05:30
Gavin D'souza
7e25cc4568 perf: Login Page
Improves performance 3x - from 0.047s to 0.017s

* Use frappe.get_*_settings to query table once
* Use cached LDAP Settings' document via get_ldap_client_settings
* Use single get_all to query all Social Login providers and related
  data
* Skip provider if client_secret doesn't exist
2022-06-13 18:39:56 +05:30
Ankush Menat
d1938ee271
perf: remove naming series from log-like doctypes (#16823)
- webhook request log
- access log
2022-05-04 10:54:52 +05:30
mergify[bot]
ee40bda491
Merge pull request #16602 from resilient-tech/int-req
refactor: Integration Request
2022-05-02 12:49:27 +00:00
Rucha Mahabal
693a6a7789 fix: frappe.log_error arguments while capturing razorpay payment failures 2022-05-01 11:34:08 +05:30
Rushabh Mehta
248c3555e3 fix(minor): add error_log for failed webhooks and web pages 2022-04-20 15:16:44 +05:30
Sagar Vora
31440f0538 refactor: Integration Request 2022-04-13 13:37:20 +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
ChillarAnand
b2fc959307 refactor: Clean up whitespace & add CI check 2022-02-25 20:01:29 +05:30
gavin
63e035923b
chore: Simplify ldap_custom_group_search resolution 2022-02-24 13:34:57 +05:30
Benedict Allerberger
7da85353c7 fix: format of ldap_settings.py 2022-02-23 15:22:57 +01:00
Benedict Allerberger
c775ca1d1d
feat(minor): Add Custom Group Search for custom LDAP servers 2022-02-21 12:42:56 +01:00
Benedict Allerberger
4fb22d0f34
fix: broken validation for custom LDAP server 2022-02-16 22:23:27 +01:00
tundebabzy
38caf3bb22
fix(File): Handle file_path is None (#15552)
* fix: S3 automatic backup fails when the backup folder is empty

* Removed conditional that returns early when
`file_path` argument is invalid i.e `None` or empty string.

This means though that the function will throw an exception if it
receives such invalid input so devs should check their inputs before
calling the function

Co-authored-by: Mohammad Hasnain Mohsin Rajan <hasnain2808@gmail.com>

Co-authored-by: Mohammad Hasnain Mohsin Rajan <hasnain2808@gmail.com>
2022-01-27 13:29:43 +05:30
Shariq Ansari
94869e8e69 fix: updated standard workspace json files 2022-01-13 18:40:36 +05:30
Rohan Bansal
10c5e732a5 fix: allow longer authorization URIs 2022-01-07 17:54:28 +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
Raffael Meyer
829475a98d
fix: don't run webhook in migrate 2021-12-25 22:53:17 +01:00
Jannat Patel
7771e0b2c9 fix: removed unused imports 2021-11-09 14:49:27 +05:30
Jannat Patel
845c589497 test: ignore permissions 2021-11-09 14:33:41 +05:30
Jannat Patel
08faf731e0 test: github login 2021-11-09 13:38:17 +05:30
Jannat Patel
88d8c1e56a fix: public info api 2021-11-08 20:17:07 +05:30
Jannat Patel
f3f01d1978 fix: github api endpoint 2021-11-03 14:58:16 +05:30
Shariq Ansari
0dfc5989fd
Merge branch 'frappe:develop' into wspace-code-cleanup 2021-10-19 20:16:33 +05:30
Sagar Vora
c560d67a57 fix: remove/update older whitelist calls 2021-10-18 16:47:11 +05:30
Shariq Ansari
6839f6b4db
Merge branch 'frappe:develop' into wspace-code-cleanup 2021-10-11 16:35:34 +05:30
Shridhar Patil
34f93330e9
fix: Missing save doc. 2021-09-29 16:24:47 +05:30
Shariq Ansari
5d00602f06 fix: Removing unused code for worspace 2021-09-20 21:27:14 +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
ebc220db39 refactor(tests): frappe.db.delete > frappe.db.sql
Use frappe.db.delete wherever possible. Get rid of all the frappe.db.sql ;)
This commit focuses on the tests written under the doctype specific
tests
2021-08-19 19:50:48 +05:30
mergify[bot]
bd6ed2033f
Merge pull request #13152 from shariquerik/wiki-based-desk
feat: Workspace 2.0
2021-08-13 06:44:32 +00:00
mergify[bot]
be5f7125cf
Merge pull request #13777 from jon-nfc/issue-13738
feat: Improve LDAP implementation to be standards compliant
2021-08-11 06:01:55 +00:00
shariquerik
5bed8031a2 fix: removed padding code from wspace json files & patch 2021-08-10 17:52:42 +05:30
shariquerik
bf4611e84b fix: updated wspace json files & minor onboarding fix 2021-08-06 14:07:22 +05:30
Shariq Ansari
cec1de0389
Merge branch 'frappe:develop' into wiki-based-desk 2021-08-05 11:30:18 +05:30
mergify[bot]
555bcc4153
feat: Improvements in Webhooks (backport #13320) (#13791)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-08-05 11:08:01 +05:30
shariquerik
84f195ca19 fix: Resolved Conflicts 2021-08-03 17:53:14 +05:30
Saqib Ansari
d6b4974bde refactor: use session.request to commonify code 2021-07-31 11:56:30 +05:30
Jon Lockwood
3beea20ddd feat(ldap): Validate additional required fields.
If the user selects 'Custom' LDAP Directory, when they hit save, validate the additional required fields ('ldap_group_objectclass' and 'ldap_group_member_attribute') for this selection to function.

Issue #13738
2021-07-30 10:59:23 +09:30
Jon Lockwood
172d1b31e8 test: LDAP unit-tests
Created unit tests for integration LDAP. These tests are designed to confirm that LDAP will continue to work after changes are made to frappe.

PR-#13777
2021-07-30 10:59:23 +09:30
Jon Lockwood
26b0fe3023 docs(ldap): update field to be a fdn
User can use any valid LDAP fdn to search. fields updated to refect.

issue #13738 PR-#13777
2021-07-30 10:59:23 +09:30
Jon Lockwood
c37e16bd09 feat(ldap): validate the user and group search path
to prevent exceptions in other locations, validate the user and group search paths at the timeof input.

issue #13738 PR-#13777
2021-07-30 10:59:23 +09:30
Jon Lockwood
99b141017f fix(ldap): fetch_ldap_groups attribute vallidation
Function requires attributes to be of type x, validate to ensure any changes will break function and to prevent further exceptions. Only output to console as it's only a developer who will generate this error.

PR-#13777
2021-07-27 11:18:32 +09:30
Jon Lockwood
1b2ec4ff77 feat(ldap): validate user fields that are ldap attributes
As the user provides some of the ldap attributes, validate those entries when the 'LDAP Settings' editor clicks save. Provide an error message if validation fails stating what is incorrect.

issue #13738 PR-#13777
2021-07-27 11:02:36 +09:30