1
0
Fork 0
mirror of https://github.com/shouptech/humulus.git synced 2026-02-03 15:09:42 +00:00

Fix update errors if yeast info is missing.

This commit is contained in:
Emma 2019-06-25 21:14:59 -06:00
parent 9c9240171c
commit 516f5b595a
2 changed files with 4 additions and 4 deletions

View file

@ -92,7 +92,7 @@ def put_doc(doc):
# Add a created timestamp
# Timestamps are written to couchdb in ISO-8601 format
doc['created'] = datetime.utcnow().isoformat()
doc['created'] = datetime.utcnow().isoformat(timespec='seconds')
return db.create_document(doc, throw_on_exists=True)
@ -102,7 +102,7 @@ def update_doc(doc):
Adds an 'updated' field representing the current time the doc was updated.
"""
doc['updated'] = datetime.utcnow().isoformat()
doc['updated'] = datetime.utcnow().isoformat(timespec='seconds')
doc.save()

View file

@ -178,8 +178,8 @@ class RecipeForm(FlaskForm):
recipe['hops'] = [h.doc for h in self.hops]
if (
self.yeast.doc['name'] and
self.yeast.doc['low_attenuation'] and
self.yeast.doc['high_attenuation']
self.yeast.doc['low_attenuation'] != "None" and
self.yeast.doc['high_attenuation'] != "None"
):
recipe['yeast'] = self.yeast.doc
return recipe