Commit graph

107 commits

Author SHA1 Message Date
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
Gavin D'souza
d357af1533 refactor: Add a maxsplit limit to string splits 2023-01-24 19:22:51 +05:30
Gavin D'souza
06cf18d0aa chore: Add optional typing hints for params with default None 2022-12-15 13:47:05 +05:30
Gavin D'souza
d3250f6504 refactor(whitelisted): Add typing hints to APIs
* Refactor type checks defined in APIs
* Remove dead/deprecated kwargs usages
* Added appropriate hints to APIs and consecutive utils defined in the following modules:
 - frappe.realtime
 - frappe.translate
 - frappe.utils.global_search
 - frappe.www.third_party_apps
 - frappe.www.search
 - frappe.www.printview
2022-12-15 13:47:05 +05:30
Gavin D'souza
3863d9bb80 fix(global_search): Trigger rebuilding on Custom Field's property change 2022-08-02 14:49:04 +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
b696fa6da5 perf: Pre-compile and re-use regexp pattern
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.

Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
2022-06-08 14:07:38 +05:30
chillaranand
1d763a6659 refactor: Fix flake8 issues 2022-05-19 15:34:35 +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
42643c3faa fix: Follow FIFO while inserting global search record
the latest enqueued value should override the value of the existing document
2022-04-01 18:47:05 +05:30
phot0n
bebc8058b6 feat: integer primary keys 2022-03-11 23:46:00 +05:30
Gavin D'souza
65864c027f chore: Update module license header
These modules were imported from the ERPNext codebase into Frappe.
License header was overlooked at that point. These were contributed
initially by Frappe Technologies Pvt Ltd under GPLv3 (ERPNext's license) and now
we, as Frappe Technologies Pvt Ltd converting them to MIT to comply with
Frappe's license.
2021-09-03 11:51:01 +05:30
Gavin D'souza
30cf8fd58d refactor: Use run instead of frappe.db.sql 2021-08-12 18:36:43 +05:30
Gavin D'souza
1015283731 fix(global_search): Typecast variable for comparision
Previously start was being type casted with int. That was reverted by refactoring query to use new Query Builder
This bug was introduced via ee3c84beef
2021-08-12 16:23:40 +05:30
saxenabhishek
7671e78487 style: minor fixes and improvements 2021-07-30 11:29:41 +05:30
saxenabhishek
ce10e36725 refactor: move all pypika functions to a module 2021-07-30 11:00:35 +05:30
saxenabhishek
ee3c84beef style: typecast to string inside db.sql 2021-07-30 11:00:35 +05:30
saxenabhishek
c05a032811 refactor: qb in global_search.search 2021-07-30 11:00:34 +05:30
Aradhya-Tripathi
84ff1d0af9 style: removed frappe.db.sql comments 2021-07-28 13:48:01 +05:30
Aradhya-Tripathi
8887836820 refactor: Moved util queries to
frappe orm
2021-07-21 23:31:15 +05:30
Bhavesh Maheshwari
68930a022a
fix: Duplicate if condition remove 2021-07-13 15:55:24 +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
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
68aa1805aa fix: Exception handling 2021-05-19 14:03:31 +05:30
Suraj Shetty
c5b9815248 fix: Add get_response_content to get page content 2021-05-14 23:43:36 +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
3c4306c87a refactor: Fix regex to avoid deprecation warnings 2021-05-10 09:18:50 +05:30
Aditya Hase
637aa059b9
perf: Remove BeautifulSoup from import tree 2021-02-19 21:01:55 +05:30
Karthikeyan Singaravelan
3a146580a8 fix: Use html.unescape for Python 3.9 compatibility. 2020-11-26 13:30:58 +00:00
Faris Ansari
f7158ad5f6 fix: Obey config for global search of web routes 2020-06-05 15:39:25 +05:30
Faris Ansari
d918d13f40 fix: Print message when global search is updated 2020-05-30 18:03:53 +05:30
Himanshu Warekar
6ea8881b29 fix: remove exact phrase search 2020-05-06 12:48:15 +05:30
Chinmay D. Pai
10e939d012
chore: update global_search and add test
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-03-30 10:46:00 +05:30
Chinmay D. Pai
063def052e
chore: remove trailing closing bracket
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-03-27 18:54:18 +05:30
Chinmay D. Pai
708248baf9
fix: avoid sqli inside global web search
Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2020-03-27 16:04:11 +05:30
mergify[bot]
710ac6b194
Merge pull request #9186 from benknowles/patch-3
fix: global search index breaking on long titles
2020-01-11 04:35:54 +00:00
Ben Knowles
ec53a57f4b fix: skip single doctype when rebuilding search index (#9187) 2020-01-10 00:34:03 +05:30
Ben Knowles
ecfc0714bc
fix: global search index breaking on long titles
If you created a doc with a title longer than 140 characters, it's supposed to be truncated to 140.

However, the global search index would break for that doctype due to an error in the query.

The truncate was happening AFTER it was escaped, causing it to lose the closing quote mark which caused a SQL error and broke the index.
2020-01-02 14:33:57 -06:00
Suraj Shetty
10701738d8
fix: Convert list to tuple 2019-12-06 08:29:02 +05:30
Suraj Shetty
3b61a6cb28 fix: Code cleanup
- Pass values so that db cursor can handle escaping
2019-12-06 07:46:49 +05:30
Himanshu Warekar
65402bc2fa tests: fix results being return 2019-12-03 15:27:10 +05:30
Himanshu Warekar
86e1d0367b Merge branch 'develop' of https://github.com/frappe/frappe into pref_global_search 2019-12-03 14:25:04 +05:30
Himanshu Warekar
9c57d80769 fix: rename function to set 2019-12-02 13:05:06 +05:30
Himanshu Warekar
633e2b546c fix: do not pop item from list 2019-11-27 12:59:50 +05:30
Gavin D'souza
5bd5eb8911 chore: moved set_request function to frappe.utils 2019-11-13 14:09:46 +05:30
Himanshu Warekar
93b9ca86f7 perf: optimise globals search 2019-10-29 15:02:10 +05:30
Himanshu Warekar
c01eadcac0 Merge branch 'develop' of https://github.com/frappe/frappe into global_tags 2019-09-30 13:59:28 +05:30
Himanshu Warekar
2bb05534f6 fix: do not add offset is start is zero 2019-09-26 17:58:13 +05:30
Himanshu Warekar
f6d1ce2194 feat: Global Tags 2019-09-24 01:03:11 +05:30
Himanshu Warekar
c4d120273b fix: priority for doctypes inglobal search 2019-09-20 11:12:45 +05:30