* fix(contact): force type check in contact whitelisted methods
* fix(google_indexing): force type check in google_indexing whitelisted methods
* fix(assignment_rule): add type checks to assignment_rule whitelisted methods
* refactor: remove unused args
* fix(queue): add type hints to whitelisted methods in queue.py
* fix(auto_email_report): add type hints to whitelisted methods
* fix(dashboard): add type hints to whitelisted methods
* fix(sidebar_item_group): add type hints to whitelisted methods
* fix(weasyprint): add type hints to whitelisted methods
* fix(backups): add type hints to whitelisted methods
* fix(document_naming_settings): add type hints to whitelisted methods
* fix(get_latest_submissions): add type hints to whitelisted methods
* fix(custom_field): add type hints to whitelisted methods
* fix(customize_form): add type hints to whitelisted methods
* fix(personal_data_deletion_request): add type hints to whitelisted functions
* fix(__init__): add type hints to whitelisted methods
* fix(prepared_report): add type hints to whitelisted methods
* fix(session_default_settings): add type hints to whitelisted methods
* fix(document_follow): add type hints to whitelisted methods
* fix(route_history): add type hints to whitelisted methods
* fix(form_tour): add type hints to whitelisted methods
* fix(dashboard_settings): add type hints to whitelisted methods
* fix(address): add type hints to whitelisted methods
* fix(contact): add type hints to whitelisted methods
* fix(discussion_reply): add type hints to whitelisted methods
* fix(auto_repeat): add type hints to whitelisted methods
* fix: add the missing type hints and misc. corrections
* fix(email): add type hints to whitelisted methods
* fix(permitted_documents_for_users): add type hints to whitelisted methods
* fix: correct the type hints
* fix: int PK types
---------
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
* feat: global `frappe.in_test` flag
* feat: helper utility to toggle `frappe.in_test`
* fix: use `toggle_test_mode` util
* fix: use `frappe.in_test`
* chore: add comment explaining global `in_test`
* chore: ignore commit replacing flag usage
* test: temporarily disable `frappe.in_test`
this worked earlier because flag was set in werkzeug.local which was separate for API test client
* test: add comment explaining change
* fix: store unsubscribe params properly
Earlier we had a field `unsubscribe_param` but it wasn't used anywhere to store the params.
This made sure only email, doctype and docname was passed as the params while unsubscribing and no custom params wasn't.
* fix: convert unsubscribe_params dict to json before storing
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: prevent emails from being queued multiple times
* style: fmt
* refactor: optimistic error handling
- Combined email queue sending to single call instead of different
branches for testing.
- If failing to get jobs -> attempt sending anyway. Failure could be
form one bad job which shouldn't completely stop everything.
* chore: type
Co-authored-by: Ankush Menat <ankush@frappe.io>
We have hardcoded "Log settings" to only apply on 3 doctypes, there are
few more logging doctypes in core which are not cleared right now, on
top of that it's not easy for user to configure all logging behaviour
from one place.
This change adds a table on log settings where logging doctypes that
support the interface required by log settings can auto-register and
show up in settings.
Currently only supported configuration is "number of days" to keep.
Currently this background job constantly fails because of the way query
is written:
1. It tries to find all docs to delete using select query
2. Deletes them by using `in query` with a HUGE amount of docs
3. Deletes child table with parent, again using `IN` query with huge
amount of docs.
This times out and never finishes on old sites.
Solution:
1. Modified deletion to straightaway delete all main table rows that are
older
2. Apply same deletion logic to child table rows.
PS: This has potential to leave some orphan child table rows behind for few more days iff modified time was later than parent doc (this is quite rare). But it's safe since child table doesn't contain "links" anyway.
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
replaced queue.send function with Queue builder.
Queue builder builds a queue from sendmail request and sends the mail
if requested to send mail immediately.
* Remove six for PY2 compatability since our dependencies are not, PY2
is legacy.
* Removed usages of utils from future/past libraries since they are
deprecated. This includes 'from __future__ ...' and 'from past...'
statements.
* Removed compatibility imports for PY2, switched from six imports to
standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass