Commit graph

123 commits

Author SHA1 Message Date
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
Akhil Narang
e34ae53c37
Merge pull request #26089 from akhilnarang/fix-redirect-routing
fix(resolver): handle werkzeug redirect exception
2024-04-22 17:07:22 +05:30
Markus Lobedann
0a4ee1d829
fix: 🐛 don't create __init__.py files when gathering pages (#26045)
* fix: 🐛 don't create __init__.py files when gathering pages

These files are only necessary if any other *.py files exists in a pages folder. Apart from that, this functions purpose (by name) is to get pages, and not create any source code files.

closes #25167

* refactor: ⚰️ remove commented out code
2024-04-22 16:53:18 +05:30
Akhil Narang
40346305a7
fix(resolver): handle werkzeug redirect exception
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-04-22 16:44:28 +05:30
Ankush Menat
d758af5960 fix: clear routing cache on homepage change 2024-03-13 23:42:59 +05:30
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
ffb9c9cf6a fix: clear sitemap cache periodically 2024-01-31 18:25:28 +05:30
Hussain Nagaria
8d2137c265 docs: consistent doc strings 2023-12-18 18:27:39 +05:30
Suraj Shetty
bc2b41d2f5 perf: Simplify dynamic route evaluation to speed up route resolution
validate complete route only if starting of the path matches with the webform route

This avoids the expensive matching from huge route_map (in sites with lots of web forms)
2023-12-08 21:15:34 +05:30
barredterra
c35476256f refactor: simplify conditional logic
Command: `sourcery review --fix --enable de-morgan .`
2023-12-05 11:14:41 +01:00
Suraj Shetty
5d85341984 feat: Hook to add dynamic routes for other web view doctypes 2023-08-17 09:30:24 +05:30
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Ankush Menat
392a506a76 perf: Cache published web forms 2023-06-04 15:13:39 +05:30
Ankush Menat
c94c0591c3 perf: cache dynamic web pages 2023-06-04 15:13:39 +05:30
Ankush Menat
6bae5a2974 fix: Dont create __init__.py in prod
closes https://github.com/frappe/frappe/issues/16618
2023-01-06 13:31:32 +05:30
Ankush Menat
7e34da6bec build(deps): bump werkzeug
Werkzeug has faster router now
2022-08-26 10:23:09 +05:30
Ankush Menat
2eec621e95 chore: db.get_all -> get_all
Reduces 1 pointless function call.
Function calls are also not "super cheap" in python.
2022-08-22 11:35:14 +05:30
Shariq Ansari
a50e0ffa08
refactor: Webform (#17232) 2022-07-19 15:52:15 +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
Gavin D'souza
a1691784a8 chore: Drop duplicate get_frontmatter definition 2022-06-13 18:39:56 +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
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
6bb96419d4 fix: Safe checks while setting doctypes_with_web_view cache 2021-06-30 15:29:49 +05:30
Suraj Shetty
2d8c6c1710 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-06-03 11:43:28 +05:30
Suraj Shetty
d13eac6f50 fix: Breadcrumbs for a page 2021-05-27 12:56:38 +05:30
Gavin D'souza
131cfaee8b fix: Close file after read
This fixes the ResourceWarning errors due to unclosed files while
utilizing the website router
2021-05-26 17:07:23 +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
Suraj Shetty
86897c1808 refactor: Remove render.py and move all utility functions to utils.py
- Replace or remove all render imports
2021-05-25 10:53:35 +05:30
Suraj Shetty
862b5320b6 refactor: Move code to appropriate files
- Delete unused resolve_route method
- move resolve_path & resolve_redirect to path_resolver
- Remove redirect.py
2021-05-20 01:29:02 +05:30
Suraj Shetty
18497989dc refactor: Remove render_page from render.py
& replace all usages of render_page with get_response
2021-05-14 21:30:28 +05:30
Suraj Shetty
20bab0f631 refactor: Move code to appropriate places 2021-05-14 18:58:04 +05:30
Suraj Shetty
56ee6e449c refactor: Remove render method
- also, move clear cache to utils.py
2021-05-14 14:17:52 +05:30
Suraj Shetty
9a3d280484 Merge branch 'develop' of https://github.com/frappe/frappe into refactor-website 2021-05-13 14:23:20 +05:30
Suraj Shetty
ba88b2cdb9 fix: Handle exception 2021-05-06 14:52:32 +05:30
Suraj Shetty
d0a8f9d01f fix: Handle exception 2021-05-05 17:26:32 +05:30
Suraj Shetty
d58191346e test: Fix exception & remove unnecessary test 2021-05-05 16:17:50 +05:30
Suraj Shetty
4895a8350d refactor: Simplify code
- Make code more readable
2021-04-28 12:20:51 +05:30
mergify[bot]
e9aa93fe98
Merge pull request #12424 from CaseSolvedUK/sitemapfix-v13
fix: Bug preventing proper detection of pages
2021-03-11 08:58:13 +00:00
Suraj Shetty
71dd300ae3
fix: Raise PageDoesNotExistError instead of DoesNotExistError (#12485)
- to avoid it getting mixed up with Document Not Found error
2021-02-26 12:59:42 +05:30
Aditya Hase
385761bcec
perf: Remove yaml from import tree 2021-02-21 09:42:21 +05:30
casesolved-co-uk
5fcdbc29bf fix: bug preventing proper detection of pages, fixes #10613 2021-02-17 17:26:06 +00:00
Rushabh Mehta
b2686e0623 fix(routing): removed /space from routing 2021-01-01 12:30:35 +05:30
Suraj Shetty
13175a8bc4 fix(website): Bust cache by passing build_version to link and script sources 2020-11-09 15:54:17 +05:30
Aditya Hase
e6aabf346c
perf(render): Don't set context.no_cache 2020-10-27 22:48:02 +05:30
Rushabh Mehta
5006ec8f51 feat(web_page): add dynamic routes to web page like /project/<project> 2020-09-21 16:51:06 +05:30
Suraj Shetty
8f6329de49
refactor: Simplify code 2020-07-22 11:23:35 +05:30
Suraj Shetty
2bf77cd82a
style: Fix sider 2020-07-22 10:32:12 +05:30
Suraj Shetty
06788762d6 fix(website): Properly load colocated javascript and style 2020-07-22 10:09:58 +05:30
Faris Ansari
48b6c9543c
fix: Set fallback base_template if source found (#10670)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-06-15 12:17:25 +05:30