* fix: ignore unittest.mock objects during typing validations
* fix: check against base mock class
---------
Co-authored-by: Rohan Bansal <rohan@agritheory.dev>
Scenario:
- One bad cron job exists
- When it fails nothing after that job is enqueued.
After this fix, that failure is skipped and rest of the jobs are enqueued.
* chore: warn if wkhtmltopdf is invalid
wkhtmltopdf ( with patched qt ) is required to generate pdfs properly.
when user clicks on PDF, pdf will be generated and downloaded.
however, on print preview page warning will be shown.
* chore: refactor based on review comments
* chore: return False incase of exception
* chore: refactor and better naming
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
* fix: pointless conditions about systemd/supervisor
What does this have to do with hostname?
* fix!: Overriden doctypes must inherit same base class
There is almost never a real need to completely override a class. After
this change we'll only allow extending and not overriding completely.
Don't pass the stringified version - this is what goes to RQ, and the string we construct isn't always "correct"
For example, 87d121f47a/frappe/email/doctype/email_queue/email_queue.py (L735-L736) generates `frappe.email.doctype.email_queue.email_queue.QueueBuilder.send_emails` which will result in `ModuleNotFoundError: No module named 'frappe.email.doctype.email_queue.email_queue.QueueBuilder'; 'frappe.email.doctype.email_queue.email_queue' is not a package`
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Frappe Builder uses safe_exec to fetch dynamic data, and there are a few functions in website utilities which would be nice to have on that end, get_html_content_based_on_type especially. I added a few others which seemed useful and safe as well.
- Regex incorrectly fetches .print-format's child styles and also extracts the wrong attribute value
- A CssParser is more maintainable and more readable as well as less prone to errors while extracting values
- Method: We extract style tag contents out of the html and tokenize them. We then filter the styles for the right selector and extract the attributes we want from them.
- This way we make sure that the right value is extracted and only the ones applicable to .print-format directly
It overrides what we set with information that isn't really useful for us.
Set a more readable method name, and add in some additional job metadata.
Signed-off-by: Akhil Narang <me@akhilnarang.dev>