use timestamp from changelog
This commit is contained in:
parent
54636fbc63
commit
9cf8417c30
2 changed files with 12 additions and 10 deletions
|
|
@ -264,7 +264,7 @@ class Item(db.Model):
|
|||
'title'
|
||||
)
|
||||
|
||||
def update_meta(self, data):
|
||||
def update_meta(self, data, modified=None):
|
||||
update = False
|
||||
record = {}
|
||||
for key in self.meta_keys:
|
||||
|
|
@ -279,13 +279,15 @@ class Item(db.Model):
|
|||
update = True
|
||||
if update:
|
||||
self.update()
|
||||
self.modified = datetime.utcnow()
|
||||
if not modified:
|
||||
modified = datetime.utcnow()
|
||||
self.modified = modified
|
||||
self.save()
|
||||
user = state.user()
|
||||
if record and user in self.users:
|
||||
Changelog.record(user, 'edititem', self.id, record)
|
||||
|
||||
def update_primaryid(self, key=None, id=None, scrape=True):
|
||||
def update_primaryid(self, key=None, id=None, scrape=True, modified=None):
|
||||
if key is None and id is None:
|
||||
if 'primaryid' not in self.meta:
|
||||
return
|
||||
|
|
@ -313,7 +315,9 @@ class Item(db.Model):
|
|||
if scrape:
|
||||
self.scrape()
|
||||
self.update_icons()
|
||||
self.modified = datetime.utcnow()
|
||||
if not modified:
|
||||
modified = datetime.utcnow()
|
||||
self.modified = modified
|
||||
self.save()
|
||||
#if not scrape:
|
||||
# Scrape.get_or_create(self.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue