add .gitkeep file so that public folder is committed to git this is
needed because if public doesn't exist, bench build doesn't
symlink the public folder to sites/assets
Noticed an issue when get_single_value wasn't returning the correct
values; by converting true to 0.
Tested it out. Here's the examples:
In [2]: sbool("2")
Out[2]: '2'
In [3]: cint(sbool("2"))
Out[3]: 2
In [4]: cint(sbool("-1"))
Out[4]: -1
In [5]: cint(sbool("0"))
Out[5]: 0
In [6]: cint(sbool("1000"))
Out[6]: 1000
In [7]: cint(sbool("10_000"))
Out[7]: 10000
In [8]: cint(sbool("true"))
Out[8]: 1
Due to collation differences in MariaDB and Postgres, tests gave
inconsistent results. This was to be handled in tests alone instead of
the application. It was unnecessary. Collation changes should be made at DBMS config
level only. Accomodating for those in the application will unnecessarily
degrade performance for everyone.
Other changes:
* use pluck in user_type
* revert ordering in nestedset
* revert parsing in order_field
* use preferred APIs & styling
Co-authored-by: gavin <gavin18d@gmail.com>
* Handle inconsistencies in type handling in DatabaseQuery & Database
APIs
* Update incompatible queries with frappe.qb notation
* Fixed use cases discovered by failing ERPNext CI tests
fix: db independent syntax for user_type
fix: handle postgres datetime values
feat: add ability to auto commit on db inserts
feat: add ability to escape underscore in postgres
fix: handle missing data in test runner bootstrapping
fix: db independent syntax for queries
fix: refactor to use qb
fix: update cache for language
fix: use pluck in email_queue
Co-authored-by: gavin <gavin18d@gmail.com>
fix: don't auto insert on tests for make_property_setter
fix: remove auto_commit in custom_field insertion
fix: remove auto_commit functionality
fix: review comments
fix: revert link validation
fix: style suggestion for readability
Co-authored-by: gavin <gavin18d@gmail.com>
fix: revert .lower() in link validation
fix: add rollback for setup_wizard
Revert "fix: add rollback for setup_wizard"
This reverts commit 83b3b0913db17718ccd5edae01858cff15603829.
Revert "feat: add ability to escape underscore in postgres"
This reverts commit 8ed9c2aa3306438e94bb813f60e65b416d0b947b.
fix: more concise representation of order fields
Co-authored-by: gavin <gavin18d@gmail.com>
This could possibly happen in case of corrupted/partial files. But for
the most part, if there's a missing trailing = or three at the end too.
Traceback:
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 68, in application
response = frappe.api.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 55, in handle
return frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1208, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 21, in savedocs
doc.save()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 285, in save
return self._save(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 307, in _save
self.insert()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 239, in insert
self._validate()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 499, in _validate
self._extract_images_from_text_editor()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 983, in _extract_images_from_text_editor
extract_images_from_doc(self, df.fieldname)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 779, in extract_images_from_doc
content = extract_images_from_html(doc, content)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 822, in extract_images_from_html
content = re.sub(r']*src\s*=\s*["\'](?=data:)(.*?)["\']', _save_file, content)
File "/home/frappe/frappe-bench/env/lib/python3.6/re.py", line 191, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 814, in _save_file
_file.save(ignore_permissions=True)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 285, in save
return self._save(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 307, in _save
self.insert()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in insert
self.run_method("before_insert")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 860, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1158, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1141, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 854, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 56, in before_insert
self.save_file(content=self.content, decode=self.decode)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 436, in save_file
self.content = base64.b64decode(self.content)
File "/home/frappe/frappe-bench/env/lib/python3.6/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
* feat: patched EmailQueue.send and frappe.utils.get_formatted_email
* chore: renamed hooks and handled an edge case
* fix: if the get_sender_details hook is defined but it returns invalid input