Commit graph

2770 commits

Author SHA1 Message Date
Ankush Menat
b7a7f97a7a refactor: convert get email count query to ORM
- also fix capitalization of column names on postgres
2022-08-16 10:53:28 +05:30
Ankush Menat
9f31723555 refactor: directly map function over lambda call 2022-08-16 10:53:28 +05:30
Ankush Menat
53af10a064 refactor!: python pretty_date consistent with JS
Python pretty date was ceiling month and week instead of flooring them,
this is incorrect AND inconsistent with popular JS library pretty date
that we use on client side
2022-08-16 10:53:28 +05:30
Ankush Menat
9de31d03c1 refactor!: timespan utils consistent output
BREAKING CHANGE:

- `get_year_ending` returns datetime.date instead of str
- `get_timespan_date_range` will always return datetime.date ranges
2022-08-16 10:53:28 +05:30
Ankush Menat
a88819230a refactor: convert get_timespan_date_range to use match 2022-08-16 10:53:28 +05:30
Ankush Menat
3fa4ec1bd6 refactor: container utils and misc tests 2022-08-16 10:53:28 +05:30
Ankush Menat
ad4cb710f2 refactor: duplication in gravatar code 2022-08-16 10:53:28 +05:30
Ankush Menat
9b5565437c refactor: extract_email_id condition
The condition made no sense and could never be True.
2022-08-16 10:53:28 +05:30
Ankush Menat
9bf9256049 test: validate name 2022-08-16 10:53:28 +05:30
Ankush Menat
26bf65b87c test: phone number validation 2022-08-16 10:53:28 +05:30
Himanshu
3faaf5f361
Merge branch 'develop' into merge_translated_doctypes 2022-08-12 13:10:49 +01:00
Gavin D'souza
a428c73a90 refactor: Itenticon
* Use later updated library code (fixes bug) from existing vendored dependency
* Update attributions.md
* Simplify usage in get_gravatar
2022-08-11 23:53:21 +05:30
Gavin D'souza
605e5a3010 refactor: make_random
* Simplify logic
* Add typing
2022-08-11 23:53:21 +05:30
Gavin D'souza
8d19a815b3 refactor: bench_helper
* Walrus operators ftw
* Pathlib to reduce verbose path joins crie
* Added typing for sanity
2022-08-11 23:53:21 +05:30
Himanshu
44c2a2e309
Merge branch 'develop' into merge_translated_doctypes 2022-08-09 11:50:32 +01:00
Faris Ansari
cafd2c920d fix(sanitize-html): allow all data-* attrs 2022-08-08 18:36:54 +05:30
hrwx
476b628a4e chore: revert changes to github workflow template 2022-08-06 10:52:59 +01:00
hrwx
b01929405d refactor: translatable doctypes 2022-08-05 21:38:10 +01:00
Gavin D'souza
2933a06e80 Merge branch 'develop' of github.com:frappe/frappe into refactor-oauth-tests 2022-08-03 16:37:38 +05:30
Ankush Menat
bdeb032fba
refactor: use separate config key for encryption (#17720) 2022-08-03 13:52:02 +05:30
Gavin D'souza
750618ca7c fix: Re-raise original exception from tenacity's retry 2022-08-03 12:01:12 +05:30
Gavin D'souza
7f2c9e84b3 feat(minor): Expose use_cookies kwarg to test client 2022-08-02 17:30:07 +05:30
Gavin D'souza
3863d9bb80 fix(global_search): Trigger rebuilding on Custom Field's property change 2022-08-02 14:49:04 +05:30
Shariq Ansari
c478673367
fix: allow to import time field (#17677) 2022-08-01 14:50:40 +05:30
Suraj Shetty
3de50b1c84
Merge pull request #17625 from netchampfaris/update-progress-bar-absolute 2022-07-27 16:55:49 +05:30
Faris Ansari
21bbe18cc4 fix: absolute option for terminal progress bar 2022-07-27 12:37:19 +05:30
phot0n
cd2664bf99 chore: remove get_payment_gateway_controller safe global 2022-07-26 23:18:23 +05:30
Gavin D'souza
2bef29bb46 chore: Deprecate backup script + minor refactors 2022-07-22 13:21:29 +05:30
Gavin D'souza
bcfa8c276e fix: Set default port attribute for Database classes
db.default_port wil be available as a class attribute to hold defaults
for DB types.

Usage: frappe.conf.db_port or frappe.db.default_port
Why: I couldn't run the mariadb command because the defaults aren't set
for my system. server is remote / containerized. Setting port in
equivalent mysql command fixes this.
2022-07-22 13:16:26 +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
a98e47150f feat(tiny): frappe.log -> frappe.log for server scripts
This it already whitelisted but in global scope.

[skip ci]
2022-07-18 16:27:28 +05:30
Ankush Menat
29c855b028
fix: db.get_value -> db.get_single_value (#17531)
db.get_value for singles returns string type always, this is confusing
behaviour, db.get_single_value should be used instead.

semgrep rule: https://github.com/frappe/semgrep-rules/pull/16
2022-07-18 15:10:49 +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
Suraj Shetty
34b1ea57f9 fix: Show "Queued" status on newsletter
Show "Queued" status on newsletter if emails are queued and "email sending" is not yet started.
2022-07-12 13:03:06 +05:30
gavin
43f378d848
Merge branch 'develop' into mariadb-client-refactor 2022-07-07 16:00:38 +05:30
Suraj Shetty
d4166dbe20 refactor: Replace html2text with markdownify 2022-07-06 08:23:14 +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
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
9a03c53572
Merge pull request #17405 from ankush/feat/currency_symbol_loc
feat: configurable location of currency symbol
2022-07-05 11:22:02 +05:30
Ankush Menat
054ad9c30c feat: Allow showing currency symbol to the right 2022-07-05 11:21:23 +05:30
gavin
93ef06f233
Merge pull request #17388 from gavindsouza/ci-mariadb-10_6
ci: Bump mariadb from 10.3 to 10.6
2022-07-05 09:51:02 +05:30
Ankush Menat
4e6ea5b554
fix: handle None as amount in fmt_money (#17395) 2022-07-04 16:27:57 +05:30
Ankush Menat
60c4819373
refactor: safer binding of outer scope in closures (#17389) 2022-07-04 13:39:56 +05:30
Gavin D'souza
65c6914068 ci: Bump mariadb from 10.3 to 10.6 2022-07-04 12:33:29 +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
Ankush Menat
aad7ebc938
fix: extra notification triggered on value change (#17364)
Since value in DB and value on object can be in different type the
notification gets triggered unnecessarily

e.g. data(2012, 10, 10) != "2012-10-10"
2022-06-30 20:25:29 +05:30