mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
form:FileOption: fix cli file check
This commit is contained in:
parent
c5758bcd30
commit
6f9203c98c
2 changed files with 2 additions and 2 deletions
|
@ -1298,7 +1298,7 @@ class TestFile(BaseTest):
|
|||
def test_basic_attrs(self):
|
||||
raw_option, option, value = self._test_basic_attrs()
|
||||
|
||||
accept = raw_option.get("accept", "") # accept default
|
||||
accept = raw_option.get("accept", None) # accept default
|
||||
assert option.accept == accept
|
||||
|
||||
def test_options_prompted_with_ask_help(self):
|
||||
|
|
|
@ -1317,7 +1317,7 @@ class FileOption(BaseInputOption):
|
|||
|
||||
if Moulinette.interface.type != "api":
|
||||
path = Path(value)
|
||||
if not (path.exists() or path.is_absolute() or path.is_file()):
|
||||
if not (path.exists() and path.is_absolute() and path.is_file()):
|
||||
raise YunohostValidationError("File doesn't exists", raw_msg=True)
|
||||
content = path.read_bytes()
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue