From f7dcb489c587564f7555afad26cdf578bd4a9fa4 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 3 Feb 2018 01:35:32 -0800 Subject: [PATCH] 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. --- etiquette/objects.py | 4 ++-- etiquette/photodb.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index ea33dc6..7293eeb 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -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') diff --git a/etiquette/photodb.py b/etiquette/photodb.py index cefb325..7c11d83 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -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,