Skip to content

Commit

Permalink
Use the required dry_run keyword argument when calling set_last_modif…
Browse files Browse the repository at this point in the history
…ied (#261)

* Use the required dry_run keyword argument when calling set_last_modified

* fix CI errors

* Update changelog
  • Loading branch information
andkrau committed Jul 18, 2022
1 parent 8ec0f8d commit 4748408
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- #251 Fix removing locks in recursive mode
- #255 Fix ERROR: Invalid requirement: 'cheroot~=8'
- #260 Fix Case-Sensitivity issue on MOVE/COPY actions through Windows DAV
- #261 Use the required dry_run keyword argument when calling set_last_modified

## 4.0.1 / 2022-01-11

Expand Down
8 changes: 6 additions & 2 deletions wsgidav/dav_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,9 @@ def set_property_value(self, name, value, *, dry_run=False):
# commands.
if name in ("{DAV:}getlastmodified", "{DAV:}last_modified"):
try:
return self.set_last_modified(self.path, value.text, dry_run)
return self.set_last_modified(
self.path, value.text, dry_run=dry_run
)
except Exception:
_logger.warning(
"Provider does not support set_last_modified on {}.".format(
Expand All @@ -806,7 +808,9 @@ def set_property_value(self, name, value, *, dry_run=False):
win32_emu = hotfixes.get("emulate_win32_lastmod", False)
if win32_emu and "MiniRedir/6.1" not in agent:
if "Win32LastModifiedTime" in name:
return self.set_last_modified(self.path, value.text, dry_run)
return self.set_last_modified(
self.path, value.text, dry_run=dry_run
)
elif "Win32FileAttributes" in name:
return True
elif "Win32CreationTime" in name:
Expand Down

0 comments on commit 4748408

Please sign in to comment.