Commit graph

111 commits

Author SHA1 Message Date
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
Shivam Mishra
529a2eb808 fix: condition for rendering source 2020-06-09 17:50:41 +05:30
Faris Ansari
44fc9c57e2 fix: Set source only if raw content 2020-06-08 18:55:58 +05:30
Faris Ansari
163aa44c33 fix: Fallback for empty hooks 2020-06-05 19:48:10 +05:30
Faris Ansari
d507597b30 fix: Show page_toc always 2020-05-31 21:31:44 +05:30
Faris Ansari
5b1dacb6a1 feat: Set base_template for routes by regex
The default `base_template` for any web route was `templates/web.html`
by default. Now, you can set the `base_template` for routes by a regex
pattern via hooks (using the key `base_template_map`). For e.g, you can
set `templates/doc.html` for routes that match the pattern `docs.*`
2020-05-24 07:33:46 +05:30
Faris Ansari
a8720d9554 fix: Extract page toc from markdown 2020-05-23 15:51:52 +05:30
Suraj Shetty
d93f8d8f3f
style: Remove unused import 2020-04-10 22:07:03 +05:30
gavin
b483c5c3c2
chore: update deprecated yaml API
Ref: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Co-Authored-By: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2020-04-10 11:15:34 +05:30
Gavin D'souza
f6412abc47 feat: handle frontmatter via internal API
chore: drop frontmatter dependency

Co-authored-by: Jonathan Beebe <me@jonbeebe.net>
2020-04-09 17:18:22 +05:30
Faris Ansari
d85cc180b4 fix: Allow frontmatter blocks in html 2020-03-16 17:30:03 +05:30
Suraj Shetty
c11aea8611 fix: Do not print frontmatter error logs (#7950) 2019-07-22 14:36:48 +05:30
Faris Ansari
6f709b8759 fix: Wrap frontmatter parsing in try except 2019-07-11 11:38:09 +05:30