Commit graph

147 commits

Author SHA1 Message Date
Ankush Menat
47fd3386fd
Revert "fix: Always reset globals on cached templates (#30897)" (#30906)
This reverts commit 32c1220c31.
2025-01-28 10:02:00 +00:00
Ankush Menat
32c1220c31
fix: Always reset globals on cached templates (#30897) 2025-01-28 05:59:57 +00:00
Ankush Menat
078330485c
fix: Re-update jinja globals on cached templates (#30882) 2025-01-27 07:08:25 +00:00
Ankush Menat
9ebfea1d08 perf: avoid duplicate template caching 2025-01-15 11:53:00 +05:30
Ankush Menat
829062b1e3 fix: make shared jenv thread-safe
A new copy is created for each request, but cache is shared.
2025-01-15 11:53:00 +05:30
Ankush Menat
2c2ec13874 perf: reuse jenv across requests 2025-01-15 11:53:00 +05:30
Ankush Menat
01f9787736 fix: catch template error for on-disk paths too 2025-01-14 20:04:36 +05:30
Ankush Menat
80f324cc04 perf: cache simple jinja templates 2025-01-14 18:26:56 +05:30
Ankush Menat
a89fd99794 perf: keep jloader across requests
This doesn't have anything that needs to be created for each request.
2025-01-14 18:18:19 +05:30
David Arnold
223640d8a7
feat: render debug timer (#28501) 2024-11-18 12:59:23 +00:00
David Arnold
7065489759
fix: jinja template html errors (#28490) 2024-11-17 10:35:09 +00:00
Ankush Menat
afed21e29f fix: dont translate syntax error messages
closes https://github.com/frappe/frappe/issues/26443
2024-05-17 13:05:06 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
Niraj Gautam
eb5448209e
fix(jinja): Update error message in validate_template function (#23783)
[skip ci]
2023-12-14 21:10:47 +05:30
David Arnold
fe8cc7a5c2
fix: non-html notifications from files 2023-11-09 09:51:39 +01:00
Sagar Vora
01c269726f fix: disallow unsafe attrs in jinja 2023-08-20 22:26:19 +05:30
Ankush Menat
5e2bbf834f refactor: filter out apps not installed on bench 2023-01-16 13:54:40 +05:30
Sagar Vora
d8b7bc18d7 refactor!: deprecate sorting based on apps.txt in get_installed_apps 2023-01-16 13:54:27 +05:30
Sagar Vora
aa53779e6b fix: improve condition to init context 2022-12-07 13:46:34 +05:30
Sagar Vora
10695d3d49 feat: make context optional when calling render_template 2022-12-07 13:32:38 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Suraj Shetty
cc725e9f48 fix: Allow empty webhook data 2022-03-29 08:56:16 +05:30
Sagar Vora
4c403333c4 fix: remove unused flag in_setup_help 2022-02-16 16:02:37 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
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.
2021-09-03 12:02:59 +05:30
Gavin D'souza
e2ee75e3cb fix: Translate strings passed in frappe.throw
* Remove trailing whitespaces in translatable strings
* Sort imports appropriately
2021-05-27 13:47:21 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* 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
2021-05-26 15:31:29 +05:30
Faris Ansari
976ebd5b2c fix: Check if path is a module first then function 2021-04-22 06:03:35 +05:30
Faris Ansari
b32db6e329 fix: method call 2021-04-17 16:11:28 +05:30
Faris Ansari
a78fed4ffc fix: Move standard filters to jinja hooks 2021-04-17 16:11:28 +05:30
Faris Ansari
1fd08d3960 refactor: Jinja hooks
- Rename hook from "jenv" to "jinja"
- You can now pass the path to the module and all of the methods in that
module will be added as methods
- You can also pass module path of a method

BREAKING CHANGE: Previous use of "jenv" hook won't work anymore
2021-04-17 16:11:28 +05:30
Faris Ansari
e90faf76b5 fix: Remove unnecessary code
- Extra spacing is only applied to templates of type Section
- should be able to call web_block without values
- default type should be Section
- set_query can be set once
2020-10-22 17:43:31 +05:30
barredterra
5d3178ed19 fix: disable padding and container by default 2020-10-20 14:53:23 +02:00
Faris Ansari
8f0f17eb7e fix: Render web blocks using web_template.render
- web_block object need not be a WebPageBlock instance
2020-09-14 15:23:14 +00:00
Faris Ansari
7a31983c90 fix: Succinct syntax for rendering web templates 2020-09-11 19:49:20 +05:30
Faris Ansari
58a819c305 fix: import 2020-09-03 13:59:20 +05:30
Faris Ansari
8c905437e6 fix: Add template validation in web_blocks 2020-09-03 13:58:22 +05:30
Emil
edcdb66b92
🎨 Change indetions to tabs
Signed-off-by: Emil <amionv99@gmail.com>
2020-06-15 12:30:44 +03:00
Emil
8a9ba93119
🎨 change construction for not in
Signed-off-by: Emil <amionv99@gmail.com>
2020-06-14 14:31:17 +03:00
Emil
267d3119f1
🐛 Return way of checking path
Signed-off-by: Emil <amionv99@gmail.com>
2020-06-14 13:26:43 +03:00
Emil
3bc66bfea1
add another way to check path
Signed-off-by: Emil <amionv99@gmail.com>
2020-06-14 12:28:21 +03:00
Emil
d25b141451
Expand list with extensions for template rendering
Signed-off-by: Emil <amionv99@gmail.com>
2020-06-14 11:37:50 +03:00
Shivam Mishra
2328fe5aa3 style: linting fixes from sider 2020-05-20 19:07:05 +05:30
Faris Ansari
2f5ff98240 fix: web_blocks global method to render web blocks 2020-05-20 16:35:23 +05:30
Faris Ansari
7a87be29c4 fix: Remove components
- Use render_template to render web_block and image_with_blur
2020-05-11 16:28:29 +05:30
Faris Ansari
42586041c1 fix: Remove unnecessary error handling 2020-04-25 20:50:57 +05:30
Faris Ansari
77281c6207 fix: tests 2020-04-25 00:43:31 +05:30
Faris Ansari
caa068932c Merge branch 'develop' of https://github.com/frappe/frappe into page-builder-tailwind 2020-04-24 23:48:29 +05:30
Faris Ansari
5ea86c6454 fix: Use Web Page Block for Navbar and Footer
- Add more Web Templates
2020-04-19 16:19:02 +05:30