Commit graph

1793 commits

Author SHA1 Message Date
Ankush Menat
404f3fbeec test: add better test for backup restoration
Before restore:
- Wipe DB, files.

After restore:
- Actually check if things got restored.
2023-10-11 18:39:12 +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
b601131d8f
fix: don't allow setting an invalid rating (#22633)
* feat: don't allow setting an invalid rating

Convert anything <0 to 0, and anything >1 to 1

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

* chore: add in tests for rating

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-10-10 15:38:58 +05:30
Shariq Ansari
9bafe1f558
Merge pull request #22408 from RitvikSardana/develop-ritvik-add-column-fix 2023-09-26 12:30:10 +05:30
RitvikSardana
9368f0aee4 fix: enable server script while testing 2023-09-26 12:02:25 +05:30
RitvikSardana
9ae56289df test: code cleanup 2023-09-25 12:31:18 +05:30
RitvikSardana
32e3198c83 test: code cleanup 2023-09-24 11:34:06 +05:30
Ankush Menat
a81fb2a11a
Merge pull request #22509 from netchampfaris/file-backup-path
fix: use relative path in file backup
2023-09-24 10:06:47 +05:30
RitvikSardana
0c2c6f2aec chore: code cleanup 2023-09-24 02:36:04 +05:30
RitvikSardana
34cd943556 test: added test for conflicting column names 2023-09-24 01:31:41 +05:30
Faris Ansari
d53a8832c8 chore: run restore test only on mariadb 2023-09-24 01:17:26 +05:30
Ankush Menat
d7a9d0111c
perf: lazy load SVG icons (#22517)
| Metric                             | Before | After | Change    |
| ---                                | ---    | ---   | ---       |
| app.html first response size       | 421kb  | 106kb | -75% (!)  |
| First response duration            | 60ms   | 40ms  | -33%      |

huge thanks to @cogk for doing most of the work for this PR on this issue: https://github.com/frappe/frappe/issues/17449#issuecomment-1728328726

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
2023-09-23 15:13:43 +05:30
Faris Ansari
18c4f653f4 chore: unskip restore test 2023-09-23 13:01:40 +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
Ankush Menat
acd1b9d64e
fix: Don't run query if dn is None (#22475) 2023-09-19 15:11:15 +00:00
Ankush Menat
0381f836d6 fix: update correct role permission rule
Right now if you have if-owner rule on doctype then whatever you change
will only apply to last inserted rule because we don't check if-owner
value

Long term better fix: Identify with perm rule name instead of arbitrary
"primary keys" defined in code.
2023-09-18 13:45:20 +05:30
Ankush Menat
662b07170c test: orpahned doctype check after patch test 2023-09-15 16:18:25 +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
b445c20e22
test: ignore whitespace changes while comparing HTML (#22386) 2023-09-13 08:18:56 +00:00
Suraj Shetty
35000c2e4f
fix: + btn not appearing for connections with both internal and external links (#22320) 2023-09-11 15:51:28 +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
anandbaburajan
1dc7a3705b fix: separate internal_and_external_links from internal_links 2023-09-05 21:41:43 +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
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
1ad5c0ea86 refactor: Avoid regex for email validation
[skip ci]
2023-09-02 11:38:56 +05:30
Raffael Meyer
1dcf1d1f4b
Merge pull request #21874 from blaggacao/fix-website-asset-discovery 2023-08-29 19:23:55 +02:00
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
8176b86b25 fix: notification_settings has_permission hooks 2023-08-29 13:26:48 +05:30
Ankush Menat
85956ed0c1 test: switch user before modifying other user 2023-08-29 12:07:58 +05:30
Ankush Menat
1b406edd54 feat: Desk User role 2023-08-28 22:31:23 +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
mergify[bot]
fdcfb82f47
Merge pull request #22114 from gavindsouza/doc-bulk_insert-include_child
fix: Handle child record insertions via bulk_insert
2023-08-25 13:57:38 +00:00
Gavin D'souza
c89130caf0
test: Add checks for child records bulk inserts
doc bulk_insert for "Role Profile" tables
2023-08-25 11:56:52 +05:30
David Arnold
414febab96
fix(test): ensure tests construe the site url from its constructor 2023-08-23 12:04:57 +02: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
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
59e49d89fe feat: include Trace ID in all SQL queries 2023-08-23 13:59:24 +05:30
Ankush Menat
04a13ca97c
fix: frappe.clear_cache should drop all keys (#22156)
We are dropping some keys which are hardcoded in function.

- this over time might be out of sync with rest of the code.
- other apps cache stuff too.

Best fix: just clear everything.
2023-08-23 11:02:45 +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
1c15c556d4 test: add more safe_eval tests 2023-08-21 11:59:53 +05:30
Sagar Vora
91ceb889cc test: ensure only property can be called for virtual docfields 2023-08-18 23:04:22 +05:30
Sagar Vora
151874c035 test: ensure get_permitted_fieldnames is called only once per doc 2023-08-18 22:47:37 +05:30
Suraj Shetty
77e5ad26fe
Merge pull request #21819 from marination/attachments-access 2023-08-17 09:46:30 +05:30
Ankush Menat
cbe816347e
Merge pull request #22017 from GursheenK/implement-like-in-compare-util
feat: implement like in compare util
2023-08-11 22:16:12 +05:30
Ankush Menat
7a5a0c27a2 fix: Support SQL like LIKE filter
Other changes:
- Ignore empty doctype in filter creator
- Simplified recorder filter evals
2023-08-11 21:24:38 +05:30
Gursheen Anand
b019a1163c feat: implement like & not like in compare util 2023-08-11 15:34:07 +05:30