* fix: Dont check for hidden-mandatory during migration
This is being added programatically and can be addressed later. No need
to fail migrations for this.
* refactor: Convert patch log naming to hash
Naming series isn't required and can cause collision if patches were
incorrectly executed or reattempted.
Creating columns that are altered in DB on save automatically is kinda
bad and will leave unnecessary columns in DB if user makes a mistake or
forgets to add a fieldname explicitly.
The default generated names are meaningless like "float_asdx", there is
no use case for this.
[skip ci]
* chore(file): better error msg for file_upload
current, if No `file` or `file_url` field set in form-data, err is cryptic:
```
172.19.0.1 - - [16/Jan/2023 16:52:27] "POST /api/method/upload_file HTTP/1.1" 403 -
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 69, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 54, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 45, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1590, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/handler.py", line 221, in upload_file
return frappe.get_doc(
File "apps/frappe/frappe/model/document.py", line 305, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 327, in _save
return self.insert()
File "apps/frappe/frappe/model/document.py", line 253, in insert
self.run_method("before_insert")
File "apps/frappe/frappe/model/document.py", line 909, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1259, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1241, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 906, in fn
return method_object(*args, **kwargs)
File "apps/frappe/frappe/core/doctype/file/file.py", line 61, in before_insert
self.set_file_name()
File "apps/frappe/frappe/core/doctype/file/file.py", line 335, in set_file_name
self.file_name = re.sub(r"/", "", self.file_name)
File "/home/frappe/.pyenv/versions/3.10.5/lib/python3.10/re.py", line 209, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
```
this pr make it understandable
* Update frappe/core/doctype/file/file.py
Co-authored-by: gavin <gavin18d@gmail.com>
* fix: SyntaxError
Co-authored-by: gavin <gavin18d@gmail.com>
- Datetime - equality doesn't make sense because of milliseconds. A separate operator for "date" part can be useful here maybe.
- Code - data like filter and remove comparison operators.
- Phone - treat like Data
- Barcode - treat like data
- attach - treat like data
- attach image - treat like data
- rating - remove invalid operators
- password - LOL
Since hook resolution depends on the order in which apps were installed
on site, it should be made configurable as escape hatch in case a
different resolution order is desired.
Keep in mind that changing order affects every hook, page, customization
so you can't pick and choose priority for individual hooks as of now.
Separate proposals are welcome for such configurabilty.
In command tests if connection is active then due to repeatable read
isolation you will continue to read old data which might be modified by
the command you're trying to test.
It makes sense to end transaction after each command execution here.
[skip ci]