mirror of
https://github.com/shouptech/humulus.git
synced 2026-02-03 16:09:44 +00:00
Fix update errors if yeast info is missing.
This commit is contained in:
parent
9c9240171c
commit
516f5b595a
2 changed files with 4 additions and 4 deletions
|
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue