* refactor: Private images rendering in PDFs
Private images currently render fine if PDF is generated during a
request as we pass the cookiejar to WKHTML.
Background jobs however fail completeley because they can't retrieve
private images without cookiejar.
This PR converts all image types to base64 encoded sources in HTML
itself, so wkhtmltopdf doesn't have to a fire a request.
* test: private images in pdf
This is beneficial since unlink is non blocking, it will run in a different thread if the data passed is large
https://redis.io/commands/unlink/
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
- Hash one time reset tokens instead of storing them as is
- Up the perm level
- Use better source of randomness for generating token
- minor code cleanup here and there
* added prefix none as default in export_fixtures
* refactor: declare prefix default later later
---------
Co-authored-by: Ankush Menat <ankush@frappe.io>
* feat: comply trackers with utm and add utm_content for a/b testing
* fix: make all other than source optional
this is plausible.io best practice
* fix: medium is not specified to be lowercase
* fix: ensure proper parameter quoting
- Extract header/footer html into `content` first, then remove any instances from the main content since it is already rendered via the extracted header/footer html
It's unlikely that a translation for the results of num2words exists, because it should return a string that is already translated in the target language. If there are some numbers that have a specific translation, then it should already be handled in the num2words library. A domain-specific library is surely better at this hypothetical task than Frappe's generic translation system.
In French, 100 is called Cent. But in English, Cent is 1/100th of a dollar, which is called Centime in French.
Expected: num2words(200).title() == "Cent"
Actual: _(num2words(200).title()) == _("Cent") == "Centime"
- `frappe.get_print` calls `get_response_content("printview")` which calls `www/printview` that adds header and footer scripts
- Now it gets added again via `pdf_header_footer.html` which causes the script to run twice
- Header and Footer html are also added twice but then removed and handled in pdf.py (because printview + wkhtml processing)
- Misc: Use walrus operator
- Remove passed `letterhead` to insert script via pdf.py, printview handles it