We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16fdd82 commit b751542Copy full SHA for b751542
tutorweb/quizdb/sync/plone.py
@@ -127,7 +127,19 @@ def compareLgs(dbLec, globalSettings):
127
128
def removePloneLecture(lectureObj):
129
"""Mark this lecture as inactive"""
130
- pass # TODO:
+ dbHost = getDbHost()
131
+ plonePath = '/'.join(lectureObj.getPhysicalPath())
132
+ try:
133
+ dbLec = Session.query(db.Lecture).with_lockmode('update') \
134
+ .filter(db.Lecture.hostId == dbHost.hostId) \
135
+ .filter(db.Lecture.plonePath == plonePath).one()
136
+ except NoResultFound:
137
+ return
138
+ dbLec.plonePath = ''.join((
139
+ datetime.datetime.utcnow().strftime('/deleted-%Y-%m-%d--%H:%M:%S'),
140
+ dbLec.plonePath,
141
+ ))
142
+ Session.flush()
143
144
def _toUTCDateTime(t):
145
"""Convert Zope DateTime into UTC datetime object"""
0 commit comments