Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZO-4687: Make date_last_modified independent of DAV server #622

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 6 additions & 0 deletions core/src/zeit/cms/checkout/manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import grokcore.component as grok
import pendulum
import zope.app.locking.interfaces
import zope.cachedescriptors.property
import zope.component
Expand Down Expand Up @@ -133,11 +134,13 @@ def checkin(self, event=True, semantic_change=None, ignore_conflicts=False, publ
self.context.uniqueId, 'Cannot checkin: %s' % reason
)
workingcopy = self.context.__parent__

sc = zeit.cms.content.interfaces.ISemanticChange(self.context)
if semantic_change is None:
semantic_change = sc.has_semantic_change
if semantic_change:
sc.update()

if event:
zope.event.notify(
zeit.cms.checkout.interfaces.BeforeCheckinEvent(
Expand All @@ -164,6 +167,9 @@ def checkin(self, event=True, semantic_change=None, ignore_conflicts=False, publ
else:
msg = _('Checked in')
zeit.objectlog.interfaces.ILog(added).log(msg)
dc = zope.dublincore.interfaces.IDCTimes(added)
if not publishing:
dc.modified = pendulum.now()
lockable = zope.app.locking.interfaces.ILockable(added, None)
# Since publishing starts and ends with its own lock()/unlock(), it
# would be premature to already unlock during the cycle() step.
Expand Down
7 changes: 6 additions & 1 deletion core/src/zeit/cms/content/dublincore.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import pendulum
import zope.dublincore.interfaces

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

Expand All @@ -15,7 +17,10 @@ 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',
writeable=WRITEABLE_LIVE,
)


Expand Down
Loading