FIX update audio

setting "end" to an empty field was resulting in the field not being
changed.
This commit is contained in:
boyska 2020-04-23 22:54:39 +02:00
parent 3fe43cdaf7
commit 51de003d95

View file

@ -1,16 +1,10 @@
import logging import logging
from datetime import datetime from datetime import datetime
from pytimeparse.timeparse import timeparse
from flask_wtf import Form from flask_wtf import Form
from wtforms import ( from pytimeparse.timeparse import timeparse
StringField, from wtforms import (SelectMultipleField, StringField, SubmitField,
validators, ValidationError, validators)
SubmitField,
SelectMultipleField,
ValidationError,
)
from larigira.formutils import EasyDateTimeField from larigira.formutils import EasyDateTimeField
@ -123,6 +117,6 @@ def frequencyalarm_receive(form):
obj["start"] = int(form.start.data.strftime("%s")) obj["start"] = int(form.start.data.strftime("%s"))
else: else:
obj["start"] = 0 obj["start"] = 0
if form.end.data:
obj["end"] = int(form.end.data.strftime("%s")) obj["end"] = int(form.end.data.strftime("%s")) if form.end.data else None
return obj return obj