Commit graph

3129 commits

Author SHA1 Message Date
Ankush Menat
d5a21a2676 fix: rename type validation
`None` can be passed which is acceptable here.

TODO: Make slackdict accept none as bool and convert to False
2023-10-16 18:12:53 +05:30
Ankush Menat
e1f2f4bb54 fix: Let social login key control signups
There are cases where certain social login keys

- Should not allow signups at all and only allow logins. E.g. social media login keys.
- Should allow signups even if global sign ups are disabled. e.g. internal SSO like setups.
2023-10-14 12:43:48 +05:30
Akhil Narang
0be3b61aec
chore: drop usage of the deprecated distutils.version.LooseVersion
Use `packaging.version.Version` instead

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-11 20:13:59 +05:30
Ankush Menat
fc16af2ac9 fix: fallback to mysqldump if mariadb-dump isn't available 2023-10-11 19:30:36 +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
Akhil Narang
091ebdd8dc
refactor(treewide): use mariadb commands directly instead of mysql (#22620)
This has been done because the mysql command issues a deprecation warning now

mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-10 12:49:16 +05:30
Ankush Menat
5d31667157 fix: Correct exit code for failed compressed file backup
addresses https://github.com/frappe/press/issues/1052

Similar to https://github.com/frappe/frappe/pull/18230
2023-09-25 23:15:11 +05:30
Ankush Menat
e9a6c4ab13 fix: user info error when name case mismatches 2023-09-23 15:26:31 +05:30
Corentin Flr
41d30e7213
feat: Add custom icons with the app_include_icons hook (#22254)
* feat: Add custom icons with the `app_include_icons` hook

These custom icons are available on the desk only. They can be picked in the `ControlIcon` picker.

Co-authored-by: Abraham Kalungi <85731451+kalungia@users.noreply.github.com>

* fix: skip conf for including icons

* test: Fix test_include_icons

---------

Co-authored-by: Abraham Kalungi <85731451+kalungia@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-09-20 20:23:17 +05:30
Bernd Oliver Sünderhauf
67376e26d4
fix: Set system timezone for Administrator and Guest users. (#22440)
* fix: Set system timezone for Administrator and Guest users.

* refactor: use constant instead of duplicating

[skip ci]

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-20 15:26:00 +05:30
Ankush Menat
e152ebc0a3 chore: typo 2023-09-18 20:16:27 +05:30
Ankush Menat
d20e436e0f perf: fetch user info in one query 2023-09-18 11:16:20 +05:30
0xsaif
87c1a9d7d7
refactor: Ensure admin receives a valid backup encryption key (#22411)
* refactor: Ensure admin receives a valid backup encryption key

- Added logic to retrieve or generate a backup encryption key if not present.

* refactor: simplify code

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-09-15 11:40:10 +05:30
Ankush Menat
909457de3d
fix: PDF and raw response (#22402) 2023-09-13 16:42:49 +00:00
0xsaif
aa7ee1c6b9
refactor: force ipv4 localhost (#22394)
* reafctor: force ipv4 localhost

Replacing "localhost" with "127.0.0.1" in the codebase; sometimes the name localhost force-resolves to ipv6

* revert: leave localhost usage in oauth tests

Change not required.

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-13 16:23:23 +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
0eb509aac3
refactor: Correct Content-Disposition headers (#22383) 2023-09-13 12:57:14 +05:30
ViralKansodiya
b0bb9a55d5
fix: error while export a doctype report in excel (#22376)
* fix: error while export a doctype report in excel

* Update frappe/utils/response.py

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-09-13 12:13:31 +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
niraj gautam
fbbdef1e9c
feat: Dynamically generate license text (#22299)
* feat: Add dynamic license dtext

* feat: Validate license name

* fix(DX): Pass options as click.Choice

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-09-05 05:45:27 +00:00
gavin
c3efddd380
fix: Allow DB Callback Managers in Safe Exec (#22302) 2023-09-05 10:38:14 +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
5215cc3c74
Merge pull request #22266 from Xieyt/fix/new-app-email-validation
fix: add Email Validation in boilerplate creation
2023-09-02 11:39:18 +05:30
Ankush Menat
1ad5c0ea86 refactor: Avoid regex for email validation
[skip ci]
2023-09-02 11:38:56 +05:30
Corentin Flr
1380241609
chore: Switch to pydantic.ConfigDict in typing_validations.py (#22268)
> PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.0/migration/
2023-09-02 11:23:50 +05:30
Corentin Flr
f88df82820
chore(rq): Pass rq.Callback objects to enqueue_call (#22271)
> DeprecationWarning: Passing a string or function for `on_failure` is deprecated, pass `Callback` instead
2023-09-02 11:22:33 +05:30
Xieyt
98fce7d633
Fix:add Email Validation 2023-08-31 14:04:54 +05:30
Ankush Menat
e9585e9ce6 fix: remove validation on text code
These can overvalidate e.g. "Frappe information technology" contains "format".

Restricted python anyways validates these attr access at runtime, so no
need to validate this on code.
2023-08-31 11:03:28 +05:30
Ankush Menat
e88cdb6e70
Merge pull request #22224 from ankush/desk_user
feat: `Desk User` role
2023-08-29 20:27:21 +05:30
Ankush Menat
1b406edd54 feat: Desk User role 2023-08-28 22:31:23 +05:30
Babuuu
173605fe2c
chore: Update boilerplate gitignore (#22220)
Add __pycache__ to .gitignore file of the new app.
2023-08-28 16:54:54 +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
Ankush Menat
74d87796af
Merge pull request #22141 from ankush/server_script_shared
refactor!: Disable server scripts by default
2023-08-23 15:19:54 +05:30
Ankush Menat
56b409d069
fix: limit job count in RQ failed registry (#22162)
* fix: limit job count in RQ failed registry

* chore: remove unnecessary test

This just checks if func is called with right values, which keep
changing as things evolve.
Everything is individually tested now so need for this test.
2023-08-23 09:21:51 +00:00
Ankush Menat
1390b972a8 fix(DX): let users know that server scripts are disabled 2023-08-23 14:49:05 +05:30
Ankush Menat
6e0b522ae3 refactor!: Disable server scripts by default
- Move the config to bench level and not site level because, server
  script "threat model" requires consent from a bench owner and not
  individual site.
- While this is a breaking change which people may not like, we believe
  it's essential to improve security model of Frappe.
2023-08-23 14:49:05 +05:30
Ankush Menat
11806c37a0 feat: error logs to include trace id 2023-08-23 14:20:24 +05:30
Ankush Menat
8ddde056a0 fix: dont allow NamedExpr in safe_eval 2023-08-21 12:42:21 +05:30
Ankush Menat
eede56d5df fix: dont allow writes to live objects 2023-08-21 12:04:55 +05:30
Ankush Menat
f449262050 fix: allow dict access and unpacks 2023-08-21 11:59:53 +05:30
Ankush Menat
14b62d7ff1 fix: correct getattr implementation for safe_eval 2023-08-21 11:59:53 +05:30
Ankush Menat
3531f58b54 refactor: unify safe_exec and safe_eval code
A lot of duplication was present for this code.
2023-08-21 11:59:53 +05:30
mergify[bot]
d6d82eb581
Merge pull request #22110 from resilient-tech/perf-as_dict-2
perf: undo regression in `as_dict` performance
2023-08-21 06:10:54 +00:00
Sagar Vora
01c269726f fix: disallow unsafe attrs in jinja 2023-08-20 22:26:19 +05:30
Sagar Vora
7dc67f2feb chore: add back getattr for virtual docfields which get value from a property 2023-08-18 21:51:56 +05:30
David Arnold
1a061d4590
fix: rely on pyenv to collect bench commands, however that may be set up (#21975) 2023-08-14 15:02:32 +05:30
Ankush Menat
8d5d371ba8 chore: off by one error in site age 2023-08-14 10:25:11 +05:30
Ankush Menat
4d5a945861
refactor: reduce duplication in unsafe attr checks (#22033) 2023-08-13 18:23:41 +05:30
Ankush Menat
ce1355dab8
fix: block format attributes (#22028) 2023-08-12 22:12:30 +05:30