Skip to content

Commit b402d72

Browse files
committed
fix logic
1 parent d92cf79 commit b402d72

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

server/mergin/sync/files.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ def validate(self, data, **kwargs):
220220
f"Unsupported file type detected: {file_path}. "
221221
f"Please remove the file or try compressing it into a ZIP file before uploading.",
222222
)
223-
224223
# new checks must restrict only new files not to block existing projects
225224
for file in data["added"]:
226225
file_path = file["path"]

server/mergin/sync/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def is_valid_path(filepath: str) -> bool:
349349

350350
def has_trailing_space(filepath: str) -> bool:
351351
"""Check filepath for trailing spaces that makes the project impossible to download on Windows"""
352-
return all(part == part.rstrip() for part in Path(filepath).parts)
352+
return any(part != part.rstrip() for part in Path(filepath).parts)
353353

354354

355355
def is_supported_extension(filepath) -> bool:

server/mergin/tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_is_valid_path(client, filepath, allow):
229229

230230

231231
def test_has_trailing_space():
232-
assert has_trailing_space("photos /lutraHQ.jpg") is False
232+
assert has_trailing_space("photos /lutraHQ.jpg") is True
233233

234234

235235
def test_get_x_accell_uri(client):

0 commit comments

Comments
 (0)