Commit graph

1596 commits

Author SHA1 Message Date
David Arnold
7bec22e238
Merge remote-tracking branch 'origin/develop' into chore/cleanup-low-level-db-interface 2024-01-18 13:22:33 +01:00
David Arnold
2b16450cf0
chore: keep frappe.connect backwards compatible for a while 2024-01-18 12:40:25 +01:00
David Arnold
f889d09d0b
fix: set defaults at the highest level interface 2024-01-17 18:59:34 +01:00
David Arnold
d87092936f
chore: simplify frappe.connect & require explicit site initialization 2024-01-17 16:53:30 +01:00
Akhil Narang
ed05acd3d0
refactor(replica): allow using separate db user name
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 12:35:01 +05:30
Akhil Narang
7419da64a1
fix: set a fallback for db user in connect()
In case we don't have a site name, `init()` won't be called, and we won't have a username

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 12:35:01 +05:30
Akhil Narang
c721fcf8c4
refactor: allow setting a db user name different from the database name
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-01-16 12:35:01 +05:30
Ankush Menat
cbf6faccb5 fix(DX): Print available sites when URL is invalid 2024-01-15 12:30:43 +05:30
Ankush Menat
447f02e8d3
fix!: Remove misleading "raise_exception" (#24266)
frappe.permission.has_permission won't accept raise_exception anymore,
it was extremely misleading argument and actual purpose of the argument
was to print perm check logs.
2024-01-11 08:24:18 +00:00
Ankush Menat
98b62e8220 fix: add _lt to extractors 2024-01-10 21:47:55 +05:30
Ankush Menat
1f6201b4af feat: lazy global translated strings 2024-01-10 21:28:01 +05:30
Ankush Menat
914406d31b feat: extend perm debugging to popular controllers
- [x] File
- [x] Communication
2024-01-10 15:16:52 +05:30
Ankush Menat
94f53d3f91 fix!: frappe.has_permission(throw=True) works as expected
- This wasn't throwing PermissionError
- It was erasing all perm check messages
2024-01-04 10:37:07 +05:30
Ankush Menat
e296a81ed9
refactor: remove dead handling for "fnargs" (#24064)
This was added for some function here: 2dd28afcb7 (diff-4a7c68f7105f3a52a7504ce52ab85bd106df91e69ab07a9f12fe23dc258870a6R266)

It's not used anywhere.
2024-01-02 05:55:15 +00:00
Akhil Narang
067104ca9c
refactor(sentry): sync up with FC implementation
Co-authored-by: Aditya Hase <aditya@adityahase.com>
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-26 12:30:10 +05:30
Ankush Menat
5e2ace4c08
perf: Use set for tracking whitelisted methods (#23905)
List look ups are O(N). This is still a microoptimization at best
considering other overhead.
2023-12-21 23:19:06 +05:30
Hussain Nagaria
c70229cd69 docs: consistency 2023-12-19 12:55:41 +05:30
Hussain Nagaria
370d575f29 docs: some more utils 2023-12-18 22:27:58 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
Hussain Nagaria
75d81da634 fix: unicode handles more than just str 2023-12-17 16:35:29 +05:30
Hussain Nagaria
cf28fe2da4 fix: consistency 2023-12-17 00:29:48 +05:30
Hussain Nagaria
1a2d8fe78a docs: get_system_settings
* IMO this should be renamed to something like `get_from_system_settings`
2023-12-16 22:18:31 +05:30
Hussain Nagaria
0fa0d1ff0e docs: frappe.bold 2023-12-16 16:48:11 +05:30
Hussain Nagaria
d5ccb51251 docs: frappe.as_json 2023-12-16 14:25:39 +05:30
Ankush Menat
71e31a4200 chore: version bump 2023-12-01 10:36:49 +05:30
Ankush Menat
0e8b4de96f fix: tweak sentry config
- disable session tracking - This causes sentry to phone home on every load, we don't need this (yet)
- disable automatic integrtaions (like redis)
- disable all default integration and cherry-pick what's required
2023-11-30 19:01:19 +05:30
Akhil Narang
9a0a5468c5 feat: setup sentry integration
Inspired primarily from sentry's generic WSGI integration

Environment variable `FRAPPE_SENTRY_DSN` needs to be enabled as well
as explicit opt-in from the user's side in system sid telemetry
settings

Conditionally include telemetry JS bundles

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-30 17:13:41 +05:30
Ankush Menat
f01937c788
fix(DX): return email queue doc (#23495) 2023-11-29 17:34:42 +00:00
Ankush Menat
957293bd54 fix: Only preload icons for desk 2023-11-29 21:50:18 +05:30
Ankush Menat
a8a8f8d438
feat: msgprint using socketio (#23408) 2023-11-24 10:54:07 +00:00
Akhil Narang
fbc88a4d24
refactor(treewide): code cleanup
Drop redundant bool conversion

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-11-23 13:57:51 +05:30
Akhil Narang
eb45da3913
feat: Allow usage of print() within safe_exec() (#23084)
* feat(safe_exec): allow usage of `print()`

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

* refactor(system_console): update description to mention `print()` instead of `log()`

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

* feat: unconditionally add debug logs to response if present

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

* chore(safe_exec): add in a test for running `print()` within safe_exec

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

* fix(safe_exec): ignore warning

RestrictedPython warns us if we call `print()` don't use their `printed` variable

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

* feat: store debug logs from scheduled jobs

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

* fix: avoid ignoring warnings, disabled in prod anyway

* chore: remove unnecessary logging

This can be moved to level 2 when required

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Ankush Menat <ankush@frappe.io>
2023-11-20 12:45:41 +05:30
Ankush Menat
089985e53b feat: frappe.job local for reading job info 2023-11-04 14:06:31 +05:30
Raffael Meyer
f0155674a5
refactor!: remove redundant sending of translations (#22962)
* chore!: remove redundant translation

* refactor!: remove "get_translated_dict" hook

Instead, include the results from
`frappe.geo.country_info.get_translated_dict` in `get_all_translations`.

* test: money_in_words uses translated currency

... and now we have translations.

* Revert "test: money_in_words uses translated currency"

This reverts commit e07d594ac1ce4b120c0fceb5d23377cb981fe820.

* refactor!: stop translating timezone and currency

* refactor: rename `get_translated_dict`

... to `get_translated_countries`
2023-11-02 20:04:14 +05:30
Ankush Menat
08b92858a3
fix: ignore duplicate perm check on assign hooks (#22832)
* fix: Ignore permissions while assigning if flag set

* fix: Avoid double permission checks on assignment rule

When it's triggered via doc events either:
- Permission check is done or
- Permission checks are not applicable
2023-10-20 06:18:19 +00:00
Corentin Flr
1a589d9354
fix: Fix get_message_log extra json.loads (#22827) 2023-10-19 23:32:09 +05:30
Sagar Vora
93a8c37977 fix: type hint for keyword-only parameter for_update
[skip ci]
2023-10-18 17:36:45 +05:30
Ankush Menat
e2714c3e1c feat: v2 error and debug log structure 2023-10-16 18:13:50 +05:30
Ankush Menat
018ed845bd refactor: defer unnecessary json-dumping of messages
Also avoid accessing locals where interface is present like for popping last message.
2023-10-16 18:13:50 +05:30
Ankush Menat
0a244b10fc test: basic tests v2 API 2023-10-16 18:12:53 +05:30
Ankush Menat
9983bf82e6 fix: backward compatible get_site_path
Before: `./sitename`
After:  `sitename`

This used to return `.` before, even though these are paths identical
they aren't REALLY. Tar command strips 2 subpaths so this ended up
breaking file restores.
2023-10-11 17:30:13 +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
Faris Ansari
fa88f1a628 fix: resolve path instead of absolute path
#22142 made the change to absolute path but it affected file backups.
Resolve path should probably be enough in most cases.
2023-09-23 11:05:49 +05:30
Ankush Menat
8cb13f922a chore(DX): Annotate all local proxies 2023-09-18 15:36:58 +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
niraj gautam
db61deef72
fix: Avoid doc caching if for_update is set (#22203)
* refactor: Avoid doc caching if for_update is set

* chore: simplify condition

---------

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2023-08-25 19:35:32 +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
mergify[bot]
fe820ae8c8
Merge pull request #22142 from barredterra/abs-pymodule-path
feat(DX): return absolute path
2023-08-23 05:40:38 +00:00