return
else:
raise NotFoundException(f'Unknown page: /{site}')
- conn.commit()
conn.close()
self._send_html(html)
except HandledException as error:
date: str, postvars: dict[str, list[str]]) -> None:
"""Update or insert Day of date and fields defined in postvars."""
day = Day.by_date(conn, date, create=True)
+ if 'comment' not in postvars.keys():
+ raise BadFormatException('missing Day.comment value')
day.comment = postvars['comment'][0]
day.save(conn)
postvars: dict[str, list[str]]) -> None:
"""Update or insert Process of id_ and fields defined in postvars."""
process = Process.by_id(conn, id_, create=True)
+ if 'title' not in postvars.keys():
+ raise BadFormatException('missing Process.title value')
+ if 'description' not in postvars.keys():
+ raise BadFormatException('missing Process.description value')
+ if 'effort' not in postvars.keys():
+ raise BadFormatException('missing Process.effort value')
process.title.set(postvars['title'][0])
process.description.set(postvars['description'][0])
effort = postvars['effort'][0]