Commit graph

312 commits

Author SHA1 Message Date
Ankush Menat
afef4b8f30
fix: add short timeout to gravatar (#24414)
closes https://github.com/frappe/frappe/issues/24377
2024-01-17 09:08:00 +00:00
Akhil Narang
9586b5f18a
fix(execute_in_shell): run explicitly in bash
`pipefail` isn't supported in sh, bash is common enough to be installed nearly everywhere

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-04 19:07:28 +05:30
Hussain Nagaria
4d20ef9200 docs: get_gravatar and get_gravatar_url 2023-12-19 12:08:50 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
Ankush Menat
1e20820846
refactor: Indicate that weak hash functions are not usedforsecurity (#23540)
[skip ci]
2023-12-01 16:04:37 +05:30
David Arnold
9228cd70f8
fix: code style 2023-11-17 09:30:53 +01:00
David Arnold
5b33608fe3
fix: shell escaping in execute_in_shell helper 2023-11-16 10:52:11 +01:00
Ankush Menat
c69b043527
fix: send correct username in userinfo (#23177) 2023-11-11 08:08:39 +00:00
Akhil Narang
1119919971
refactor: use gzip library's compress() and decompress() methods directly
The util methods were added for python2.7 compat, mark them as deprecated

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-20 21:17:35 +05:30
Sambasiva Suda
7165f94148
fix: validate_email_addr should return email id as it is if it is valid (#22613) 2023-10-11 12:37:48 +05:30
Ankush Menat
e9a6c4ab13 fix: user info error when name case mismatches 2023-09-23 15:26:31 +05:30
Ankush Menat
d20e436e0f perf: fetch user info in one query 2023-09-18 11:16:20 +05:30
Ankush Menat
970a740164
revert: #22308 (#22389)
* Revert "chore: move function to correct file"

This reverts commit ebfdfa283b.

* Revert "refactor!: merge get_site_url into get_url (#22308)"

This reverts commit 2001bc278f.
2023-09-13 14:34:52 +05:30
Ankush Menat
ebfdfa283b chore: move function to correct file 2023-09-11 19:02:34 +05:30
David Arnold
2001bc278f
refactor!: merge get_site_url into get_url (#22308)
* chore: merge get_site_url into get_url

* fix: keep alias with deprecation notice
2023-09-11 15:09:05 +05:30
David Arnold
011e44656b
fix(test): ensure tests construe the site url from its constructor (#21870) 2023-09-02 15:36:24 +05:30
Ankush Menat
961585f1d9
fix: misc dx improvemnts (#22188)
* fix(dx): simplify adding callbacks

frappe.db.after_commit(func) == frappe.db.after_commit.add(func)

* fix: trace id missing

DB gets initted before request
2023-08-28 07:01:25 +00:00
Sagar Vora
7dc67f2feb chore: add back getattr for virtual docfields which get value from a property 2023-08-18 21:51:56 +05:30
Ankush Menat
a1f3114305
fix: sanitize frappe._dicts too in TB sanitizer (#22012) 2023-08-11 12:25:40 +05:30
barredterra
88c8baa9ee refactor: for append to extend, merge list extend
Replace a for append loop with list extend.
Create the list with values instead of creating
an empty list and extending it with another list.
2023-08-09 13:25:39 +02:00
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
David Arnold
3471685eaa
feat(ops): add environment variable to set bench root / workdir (#21872) 2023-07-31 11:50:09 +05:30
Ankush Menat
79532ea0f2 fix: incorrect cache clearing of assets
- Build version wasn't correctly computed since v14 update of build
  system. This makes client side cache useless.
- We clear cache assuming rapid reloads,but opening new tab also does
  that. This makes the cache effectively useless for most users.
2023-07-15 21:59:04 +05:30
Ankush Menat
adf30693a9 ci: update pyupgrade 2023-07-14 14:24:08 +05:30
Ankush Menat
8a37d6d278
perf: reduce memory usage of background processes (#21467)
* perf: defer translation.py imports

This indirectly imports babel which isn't really required most of the
time.

* perf: defer gzip import

* perf: move validate_and_sanitize_search_inputs

This causes all sorts of indirect imports and increases memory usage

* perf: defer requests module imports

* perf: defer system settings import

* perf: defer LOG_DOCTYPES import

Causes many indirect imports

* perf: defer update_site_config

* perf: defer notifications import

* perf: remove unused import

* perf: defer safe exec import

* test: memory usage overhead
2023-06-23 12:51:45 +05:30
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Ankush Menat
6ce7444669 refactor: generic callback manager 2023-06-03 18:44:19 +05:30
Sabu Siyad
a1aaed0a5f
feat(util): get_table_name: wrap in backticks (#20553) 2023-04-03 11:26:49 +05:30
Ankush Menat
cd4d601ed4 fix: traceback sanitizer got extra positional args 2023-02-15 17:51:21 +05:30
Ankush Menat
338ccc5a2a
fix: sanitize form dict in error logs (#19835)
[skip ci]
2023-01-30 15:22:21 +05:30
Ankush Menat
70ee9272b1
fix: sanitize traceback for common secrets (#19805) 2023-01-27 12:44:33 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Ankush Menat
35ba00a54e
fix: handle isatty correctly (#18277)
sys.stdin can be `None`

[skip ci]
2022-10-03 12:05:55 +05:30
Ankush Menat
abeed35461
fix: throw exception if backup failed (#18230) 2022-09-28 14:29:38 +05:30
Ankush Menat
c76277f1bf fix: correctly order args and kwargs 2022-09-26 11:26:03 +05:30
Ankush Menat
17d327719e build(deps): drop unused dependencies
- googlemaps
- google-auth-httplib2
- urllib3
- pypng
- pyasn1
- gitdb
2022-08-26 10:23:09 +05:30
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
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
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
7f2c9e84b3 feat(minor): Expose use_cookies kwarg to test client 2022-08-02 17:30:07 +05:30
Faris Ansari
21bbe18cc4 fix: absolute option for terminal progress bar 2022-07-27 12:37:19 +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
Suraj Shetty
8e2555f510
fix: Erroneous regex usage
Fixes: https://github.com/frappe/frappe/pull/17111#issuecomment-1150118499

Issue introduce via: https://github.com/frappe/frappe/pull/17111
2022-06-09 07:12:04 +05:30
Gavin D'souza
b696fa6da5 perf: Pre-compile and re-use regexp pattern
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.

Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
2022-06-08 14:07:38 +05:30
Suraj Shetty
ccc82e2c4c
Merge pull request #15538 from noahjacob/phone_field_control
feat: Phone Control Type
2022-04-28 10:27:52 +05:30
Gavin D'souza
418dcdd2f4 fix!: Use event as a differentiator for frappe.utils.log 2022-04-21 13:33:40 +05:30