Remove unnecessary intification of timestamps.

I decided I want to have higher precision especially because
batch inserts were having several photos with the same
created timestamp making orderby >= dumb.
This commit is contained in:
voussoir 2018-02-03 01:35:32 -08:00
parent b39f2e3f7b
commit f7dcb489c5
2 changed files with 4 additions and 4 deletions

View file

@ -613,7 +613,7 @@ class Photo(ObjectBase):
self.remove_tag(parent)
self.photodb.log.debug('Applying tag {tag:s} to photo {pho:s}'.format(tag=tag, pho=self))
now = int(helpers.now())
now = helpers.now()
cur = self.photodb.sql.cursor()
cur.execute('INSERT INTO photo_tag_rel VALUES(?, ?)', [self.id, tag.id])
cur.execute('UPDATE photos SET tagged_at = ? WHERE id == ?', [now, self.id])
@ -925,7 +925,7 @@ class Photo(ObjectBase):
'DELETE FROM photo_tag_rel WHERE photoid == ? AND tagid == ?',
[self.id, tag.id]
)
now = int(helpers.now())
now = helpers.now()
cur.execute('UPDATE photos SET tagged_at = ? WHERE id == ?', [now, self.id])
if commit:
self.photodb.log.debug('Committing - remove photo tag')

View file

@ -272,7 +272,7 @@ class PDBPhotoMixin:
self.log.debug('New Photo: %s', filepath.absolute_path)
author_id = self.get_user_id_or_none(author)
created = int(helpers.now())
created = helpers.now()
photo_id = self.generate_id('photos')
data = {
@ -965,7 +965,7 @@ class PDBUserMixin:
user_id = self.generate_user_id()
hashed_password = bcrypt.hashpw(password, bcrypt.gensalt())
created = int(helpers.now())
created = helpers.now()
data = {
'id': user_id,