FIX update audio
setting "end" to an empty field was resulting in the field not being changed.
Этот коммит содержится в:
родитель
3fe43cdaf7
коммит
51de003d95
1 изменённых файлов: 5 добавлений и 11 удалений
|
@ -1,16 +1,10 @@
|
|||
import logging
|
||||
|
||||
from datetime import datetime
|
||||
from pytimeparse.timeparse import timeparse
|
||||
|
||||
from flask_wtf import Form
|
||||
from wtforms import (
|
||||
StringField,
|
||||
validators,
|
||||
SubmitField,
|
||||
SelectMultipleField,
|
||||
ValidationError,
|
||||
)
|
||||
from pytimeparse.timeparse import timeparse
|
||||
from wtforms import (SelectMultipleField, StringField, SubmitField,
|
||||
ValidationError, validators)
|
||||
|
||||
from larigira.formutils import EasyDateTimeField
|
||||
|
||||
|
@ -123,6 +117,6 @@ def frequencyalarm_receive(form):
|
|||
obj["start"] = int(form.start.data.strftime("%s"))
|
||||
else:
|
||||
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
|
||||
|
|
Загрузка…
Сослаться в новой задаче