[sync] Image save by file not by hash

This commit is contained in:
tmshv committed 2019-10-17 18:51:08 +03:00
1 parent e9fa1376e3
commit dd0ec5f203
1 file changed
+2 -2
+2 -2
View File
@@ -156,10 +156,10 @@ class Image(Model):
def sync_image(record):
from db import db
q = {'hash': record['hash']}
q = {'file': record['file']}
try:
db().images.update_one(q, {'$set': record}, upsert=True)
i = db().images.find_one({'hash': record['hash']})
i = db().images.find_one({'file': record['file']})
return i
except ValueError:
pass