Commit graph

15 commits

Author SHA1 Message Date
Ankush Menat
d711c1fb7e
test: use FrappeTestCase for cleaning up state (#17768) 2022-08-09 16:26:40 +05:30
Ankush Menat
d90d6536ef perf: dont rebuild same translation dict 2022-05-22 22:54:23 +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
Karthikeyan Singaravelan
880832671a fix: use assertEqual instead of assertEquals for Python 3.11 compatibility 2022-03-21 11:05:43 +00:00
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
Mohammad Hasnain Mohsin Rajan
7ab7da5c65
fix: only enabled users in mentions (#14017)
* fix: only enabled users in mentions

* Update frappe/desk/search.py

Co-authored-by: gavin <gavin18d@gmail.com>

* test: add test cases to disallow disabled in mention

* test: pass roles as single values

* style: Remove extra space and line

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
Co-authored-by: gavin <gavin18d@gmail.com>
2021-08-27 05:09:40 +00:00
Gavin D'souza
6f17e3d45f perf(test_search): Setup and teardown tests only if needed 2021-07-14 12:02:33 +05:30
codescientist703
b619c3d330 test: added test for order of link 2021-07-13 20:24:24 +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
Rushabh Mehta
864956e30f fix(minor): homepage for frappe and tests 2021-01-01 18:03:06 +05:30
Suraj Shetty
3368d83238
fix: Remove @ from relevance query (#11837) 2020-11-02 13:07:09 +05:30
Suraj Shetty
cd1ab8e23c
feat: Add validate_and_sanitize_search_inputs decorator (#11194)
* feat: Add validate_and_sanitize_search_inputs decorator

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: Prssanna Desai <prssud@gmail.com>
Co-authored-by: Shivam Mishra <scmmishra@users.noreply.github.com>

* refactor: Move validate_and_sanitize_search_inputs to init

* refactor: Move validate_and_sanitize_search_inputs to search.py

* test: validate_and_sanitize_search_inputs decorator

* chore: Add wrapt module

* refactor: Use @wrapt to define validate_and_sanitize_search_inputs decorator

* test: Add a case to make sure frappe.call works as well

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: Prssanna Desai <prssud@gmail.com>
Co-authored-by: Shivam Mishra <scmmishra@users.noreply.github.com>
2020-08-05 19:41:41 +05:30
Charles-Henri Decultot
dab491e55f Doctype links in foreign language (#5745)
* Doctype search in foreign language

* List comprehension slightly faster

* Remove obsolete comment

* Remove trailing whitespace

* Test case for address and contact query

* Refactor search and add tests

* Travis test debug

* Remove debug print

* Search limit removal for untranslated docs and tests refactor

* Remove old comments

* Test modification for Travis

* remove unused import

* Correct Role doctype
2018-08-24 15:23:20 +05:30
Saurabh
081b17fbe8 [security][fix] tighten criteria to prevent sql injection in search-f… (#5800)
* [security][fix] tighten criteria to prevent sql injection in search-fields

* test cases
2018-07-11 11:04:51 +05:30
Saurabh
e9cdf322c6 [security][fix] Sanitize search fields to avoid sql injection (#5713)
* [security][fix] Sanitize search fields to avoid sql injection

* Test Cases for Sanitizer

* Test Cases fix

* [fix] test case
2018-06-25 11:23:32 +05:30