Skip to content

Commit

Permalink
ZO-4687: Make date_last_modified independent of DAV server
Browse files Browse the repository at this point in the history
  • Loading branch information
louika committed Feb 15, 2024
1 parent 76787d3 commit 86aab04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/docs/changelog/ZO-4687.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZO-4687: Make date_last_modified independent of DAV server
7 changes: 7 additions & 0 deletions core/src/zeit/cms/checkout/manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from datetime import datetime

import grokcore.component as grok
import zope.app.locking.interfaces
import zope.cachedescriptors.property
Expand Down Expand Up @@ -138,6 +140,11 @@ def checkin(self, event=True, semantic_change=None, ignore_conflicts=False, publ
semantic_change = sc.has_semantic_change
if semantic_change:
sc.update()

dc = zope.dublincore.interfaces.IDCTimes(self.context)
if not publishing:
dc.modified = datetime.now()

if event:
zope.event.notify(
zeit.cms.checkout.interfaces.BeforeCheckinEvent(
Expand Down
5 changes: 4 additions & 1 deletion core/src/zeit/cms/content/dublincore.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import zope.dublincore.interfaces

import zeit.cms.content.dav
import zeit.cms.interfaces
import zeit.cms.repository.interfaces
import zeit.cms.workingcopy.interfaces

Expand All @@ -15,7 +16,9 @@ class RepositoryDCTimes(zeit.cms.content.dav.DAVPropertiesAdapter):
zope.dublincore.interfaces.IDCTimes['created'], 'DAV:', 'creationdate'
)
modified = zeit.cms.content.dav.DAVProperty(
zope.dublincore.interfaces.IDCTimes['modified'], 'DAV:', 'getlastmodified'
zope.dublincore.interfaces.IDCTimes['modified'],
zeit.cms.interfaces.DOCUMENT_SCHEMA_NS,
'date_last_modified',
)


Expand Down

0 comments on commit 86aab04

Please sign in to comment.