* 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>
When email queue batch failes >33% with >10 count, frappe will now abort
sending emails.
We already notify users via system notification so this
assumes that user will notice it and fix it in sometime.
With previous commits we also prioritize fresh emails over retries.
* fix: Remove incorrect fallback
If you do +1 on date it will also start considering next date. This was
only done to accomodate date filter on datetime fields. Which also
doesn't really work.
* refactor: simplify fieldtype detection
* fix!: Correct datetime fallbacks for between filters
* chore: remove unncessary test
This is very specific and introduces flake when the job tests run before
it.
* 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
This lets us create three types of APIs:
- Document APIs that operate on documents
- DocType APIs that operate on collections - list, count, search
- Method APIs that are RPC calls
* refactor!: Drop handling for SQL queries
This hasn't been supported in really long time, no need to check that
use cases.
It will still fail but with no special error message.
* fix: Catch all import related errors
* fix!: Use last query from hooks
* refactor!: Return search results like any other function
Search results are returned in `results` key which is incosistent from
most other functions
* refactor: simplify search_link
Meta order in most cases is default "modified" which doesn't quite help.
idx is # of times a document is referred to somewhere else, which is
more likely to be relevant.
When `locate` returns 0 it's shown on top instead it should be shown
last or not shown at all.
This is math hack to avoid using any complex SQL functionality which
isn't allowed in DB query.
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.
| 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>