Merge branch 'develop' into get-context-without-param
This commit is contained in:
commit
0002ba6353
6 changed files with 30 additions and 11 deletions
1
.github/workflows/ci-tests.yml
vendored
1
.github/workflows/ci-tests.yml
vendored
|
|
@ -101,6 +101,7 @@ jobs:
|
|||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Cache cypress binary
|
||||
if: matrix.TYPE == 'ui'
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache
|
||||
|
|
|
|||
|
|
@ -863,8 +863,8 @@ def reset_password(user):
|
|||
@frappe.whitelist()
|
||||
@frappe.validate_and_sanitize_search_inputs
|
||||
def user_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
from frappe.desk.reportview import get_match_cond
|
||||
|
||||
from frappe.desk.reportview import get_match_cond, get_filters_cond
|
||||
conditions=[]
|
||||
user_type_condition = "and user_type = 'System User'"
|
||||
if filters and filters.get('ignore_user_type'):
|
||||
user_type_condition = ''
|
||||
|
|
@ -878,17 +878,22 @@ def user_query(doctype, txt, searchfield, start, page_len, filters):
|
|||
AND `name` NOT IN ({standard_users})
|
||||
AND ({key} LIKE %(txt)s
|
||||
OR CONCAT_WS(' ', first_name, middle_name, last_name) LIKE %(txt)s)
|
||||
{mcond}
|
||||
{fcond} {mcond}
|
||||
ORDER BY
|
||||
CASE WHEN `name` LIKE %(txt)s THEN 0 ELSE 1 END,
|
||||
CASE WHEN concat_ws(' ', first_name, middle_name, last_name) LIKE %(txt)s
|
||||
THEN 0 ELSE 1 END,
|
||||
NAME asc
|
||||
LIMIT %(page_len)s OFFSET %(start)s""".format(
|
||||
LIMIT %(page_len)s OFFSET %(start)s
|
||||
""".format(
|
||||
user_type_condition = user_type_condition,
|
||||
standard_users=", ".join([frappe.db.escape(u) for u in STANDARD_USERS]),
|
||||
key=searchfield, mcond=get_match_cond(doctype)),
|
||||
dict(start=start, page_len=page_len, txt=txt))
|
||||
key=searchfield,
|
||||
fcond=get_filters_cond(doctype, filters, conditions),
|
||||
mcond=get_match_cond(doctype)
|
||||
),
|
||||
dict(start=start, page_len=page_len, txt=txt)
|
||||
)
|
||||
|
||||
def get_total_users():
|
||||
"""Returns total no. of system users"""
|
||||
|
|
|
|||
|
|
@ -403,6 +403,14 @@ def call_hook_method(hook, *args, **kwargs):
|
|||
return out
|
||||
|
||||
def update_progress_bar(txt, i, l):
|
||||
if os.environ.get("CI"):
|
||||
if i == 0:
|
||||
sys.stdout.write(txt)
|
||||
|
||||
sys.stdout.write(".")
|
||||
sys.stdout.flush()
|
||||
return
|
||||
|
||||
if not getattr(frappe.local, 'request', None):
|
||||
lt = len(txt)
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -11,8 +11,12 @@ from frappe.website.render import render
|
|||
from frappe.utils import random_string
|
||||
from frappe.website.doctype.blog_post.blog_post import get_blog_list
|
||||
from frappe.website.website_generator import WebsiteGenerator
|
||||
from frappe.custom.doctype.customize_form.customize_form import reset_customization
|
||||
|
||||
class TestBlogPost(unittest.TestCase):
|
||||
def setUp(self):
|
||||
reset_customization('Blog Post')
|
||||
|
||||
def test_generator_view(self):
|
||||
pages = frappe.get_all('Blog Post', fields=['name', 'route'],
|
||||
filters={'published': 1, 'route': ('!=', '')}, limit =1)
|
||||
|
|
@ -97,6 +101,7 @@ def make_test_blog(category_title="Test Blog Category"):
|
|||
doctype = 'Blogger',
|
||||
short_name='test-blogger',
|
||||
full_name='Test Blogger')).insert()
|
||||
|
||||
test_blog = frappe.get_doc(dict(
|
||||
doctype = 'Blog Post',
|
||||
blog_category = category_name,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
"driver.js": "^0.9.8",
|
||||
"express": "^4.17.1",
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
"frappe-charts": "^2.0.0-rc10",
|
||||
"frappe-charts": "^2.0.0-rc11",
|
||||
"frappe-datatable": "^1.15.3",
|
||||
"frappe-gantt": "^0.5.0",
|
||||
"fuse.js": "^3.4.6",
|
||||
|
|
|
|||
|
|
@ -2467,10 +2467,10 @@ fragment-cache@^0.2.1:
|
|||
dependencies:
|
||||
map-cache "^0.2.2"
|
||||
|
||||
frappe-charts@^2.0.0-rc10:
|
||||
version "2.0.0-rc10"
|
||||
resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-2.0.0-rc10.tgz#6e4cfbb99eb48374f78c0c048e1b04f278a3848a"
|
||||
integrity sha512-qj1yFdBF7e0aW6xES/SK7cb4plimcm63ENG/0HOMKprijNj0V938/v9uhe1lSATvuqu65pPkHNbt93zfCLx9gQ==
|
||||
frappe-charts@^2.0.0-rc11:
|
||||
version "2.0.0-rc11"
|
||||
resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-2.0.0-rc11.tgz#0724fa0d43593362c075c3805ebbbe1a608fcef7"
|
||||
integrity sha512-DY3tThT1lNGcJlRMOtIhnILtSm5h1iKysWhZAyj7yrGiOnOWbZpYx/NZzXZYwtRrWwMlYiLX2ylV76qo31ONsg==
|
||||
|
||||
frappe-datatable@^1.15.3:
|
||||
version "1.15.3"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue