Commit graph

55 commits

Author SHA1 Message Date
Akhil Narang
26ae0f3460
fix: ruff fixes
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-07 17:04:31 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Corentin Flr
c9c8414562
fix(website): Handle virtual DocTypes webview routing (#24445)
Co-authored-by: Charles-Henri Decultot <chdecultot@dokos.io>
2024-02-05 12:47:09 +05:30
Ankush Menat
8c515a9a5d fix: correct perm check for guests
Allow viewing document page if doctype allows guest to view
2023-12-29 17:59:39 +05:30
Ankush Menat
38314aec59
fix: Check permissions before rendering web view (#24032) 2023-12-29 17:07:17 +05:30
Akhil Narang
44667901bf
feat: allow setting a custom http status code for redirects
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2023-12-20 17:36:42 +05:30
Suraj Shetty
7452e71d02 perf: Use get_cached_doc instead of get_doc
- Makes document pages with no-cache load a bit faster
2023-12-08 20:55:25 +05:30
18alantom
5722d9c2ba fix: set sidebar only if not present
The get_context of some templates set their own sidebar
if this is done, no need to override
2023-11-29 12:11:34 +05:30
Corentin Forler
443ffa06d5
fix(NotPermittedPage): Add redirect-to even if starting with /app
A page like "/appointment" would redirect to /login, but without the redirect-to parameter, which is undesired
2023-09-27 12:16:06 +02: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
Gursheen Kaur Anand
149467a71b
fix: fetch portal sidebar items (#21703) 2023-07-18 09:34:52 +05:30
Corentin Flr
69d0060bdf
chore: format code 2023-06-30 11:52:29 +02:00
Ankush Menat
f3c876e43e
chore: ignore pyo files too 2023-06-28 11:43:23 +05:30
Corentin Flr
bcdc483a13
fix(test): Fix test_never_render to get path as string, exclude PYC files from static downloads
This test code never actually tested the behaviour for two reasons:
- first, the page had an error which meant that a 500 Error page was returned (because `path` is not a string)
- second, every page contains the string "400" because it's contained in some of the icons.svg icons!

I also found a minor related bug in static_page.py, allowing people to download PYC files (pycache)
2023-06-15 18:36:30 +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
7c7c11b454 perf: Cache web view routes
Each call to evaluate if route is web view makes N queries where N = #
of web view doctypes. This entire computation can be definitely cached
for short duration.

- Added cache bursting in WebsiteGenerator doctype updates.
- Added 60 minutes TTL in case cache invalidation wasn't done reliably.
2023-06-04 15:13:39 +05:30
Ankush Menat
eb8da5fd59
fix!: Correct resolution order for template page (#20927)
Current resolution is confusing mess:

1. Evaluation is done in order of installed app, first install wins
2. Except frappe, frappe is treated as lowest priority.

Following same principle of "last write wins" everywhere similar to
previous PRs:

- https://github.com/frappe/frappe/pull/17869
- https://github.com/frappe/frappe/pull/20648
- https://github.com/frappe/frappe/pull/19653

Closes https://github.com/frappe/frappe/issues/20377
2023-05-07 13:19:23 +05:30
gavin
cd524135c0
fix: TemplatePage.can_render (#20257)
Don't render python executable/loadable files from TemplatePage
renderer. This restricts access to reading/downloading possibly
private Python source code from Frappe applications
2023-03-06 12:40:15 +05:30
mergify[bot]
3a130abfc5
fix: extension extracted if at least one dot, because if not dot (#19946) (#20142)
(cherry picked from commit 53c41e0ce6bf9985786a570c43fd32c79332c44c)

Co-authored-by: Jaime <developmentforpeople@gmail.com>
2023-02-23 15:03:11 +05:30
Shariq Ansari
abc5b51e57 fix: after login if redirect is used getting blank screen 2023-01-05 20:39:35 +05:30
PeterG
4ec7d2dbba
feat(minor): redirect after login from NotPermittedPage (#18946)
* redirect after login from NotPermittedPage
2022-11-21 14:56:18 +05:30
Ankush Menat
cc72dc47ab
fix: Show error page even when routing fails (#18437) 2022-10-17 19:52:37 +05:30
Ankush Menat
786df3fbeb perf: ~33% faster Desk response
- hardcode `/app` resolution
- use cached website settings everywhere. It was mixing cache and DB
  everywhere and re-quering same thing (why ?)
2022-08-21 17:35:07 +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
Suraj Shetty
1431cb26d3 fix: Catch any expection and show proper error page
- Also, show title & message if it is defined in the exception class
2022-06-01 08:08:52 +05:30
Suraj Shetty
d23b293e1e fix(webform): Only show published web forms 2022-05-09 19:22:13 +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
9dbaf252f0 fix: Check if binary file in Page Renderers
* Check if binary before rendering using StaticPage resolver
* Check if not binary before rendering using TemplatePage resolver
2022-01-19 19:30:45 +05:30
Faris Ansari
2c3b179197 fix: ability to disable safe_render for template pages 2021-08-03 11:57:42 +05:30
Gavin D'souza
c85ff679ef fix(NotFoundPage): Set default value for http_status_code 2021-07-16 12:02:13 +05:30
Suraj Shetty
508f47e871 fix: Minified js load 2021-07-03 14:13:02 +05:30
Suraj Shetty
02e735da8e fix: Do not set base template for resource 2021-07-01 22:06:26 +05:30
Suraj Shetty
e8d41c945c refactor: Use build_response in WebPage class 2021-06-24 18:01:09 +05:30
Suraj Shetty
57e41230b8 fix: Set source after updating context 2021-06-24 17:52:18 +05:30
Suraj Shetty
9e8aadf2f9 fix: Move context building to get_html 2021-06-24 15:19:48 +05:30
Suraj Shetty
2e21d1cb66 fix: Replace deprecated method 2021-06-24 12:01:49 +05:30
Suraj Shetty
2584b77cf1 fix: Do not cache csrf token 2021-06-24 10:24:47 +05:30
Suraj Shetty
0aabe737a3 fix: Cache document page as well 2021-06-24 10:24:20 +05:30
Suraj Shetty
9293807ef3 fix: Restore ability use get_context without params
- https://github.com/frappe/frappe/pull/12609

The feature got removed during the website routing
refactor https://github.com/frappe/frappe/pull/12334
2021-06-24 10:02:30 +05:30
Suraj Shetty
59be3afc2d fix: Only replace hyphen in file name 2021-06-17 15:30:27 +05:30
Suraj Shetty
1e926b55ce fix: Rename WebPage to BaseRenderer 2021-06-15 14:01:56 +05:30
Suraj Shetty
0387b8f027 fix: WebForm render 2021-06-04 14:25:48 +05:30
Suraj Shetty
63a42f54b2 fix: Deprecation warning 2021-05-31 14:55:23 +05:30
Suraj Shetty
369adf5a3a fix: Set default value as empty string 2021-05-27 14:44:47 +05:30
Suraj Shetty
c8749bcc72 fix: get_index_path_options method 2021-05-27 14:27:30 +05:30
Suraj Shetty
d13eac6f50 fix: Breadcrumbs for a page 2021-05-27 12:56:38 +05:30