process_id = self._params.get_int_or_none('process_id')
comment_pattern = self._params.get_str_or_fail('comment_pattern', '')
#
- todos = []
ret = Todo.by_date_range_with_limits(self._conn, (start, end))
todos_by_date_range, start, end = ret
todos = [t for t in todos_by_date_range
owner_ids = self._params.get_all_int('step_to')
owned_ids = self._params.get_all_int('has_step')
title_64 = self._params.get_str('title_b64')
- #
+ title_new = None
if title_64:
try:
- title = b64decode(title_64.encode()).decode()
+ title_new = b64decode(title_64.encode()).decode()
except binascii_Exception as exc:
msg = 'invalid base64 for ?title_b64='
raise BadFormatException(msg) from exc
- process.title.set(title)
+ #
+ if title_new:
+ process.title.set(title_new)
preset_top_step = None
owners = process.used_as_step_by(self._conn)
for step_id in owner_ids:
comments = self._form.get_all_str('comment')
efforts = self._form.get_all_floats_or_nones('effort')
done_todos = self._form.get_all_int('done')
- #
- for _ in [id_ for id_ in done_todos if id_ not in old_todos]:
- raise BadFormatException('"done" field refers to unknown Todo')
is_done = [t_id in done_todos for t_id in old_todos]
if not (len(old_todos) == len(is_done) == len(comments)
== len(efforts)):
msg = 'not equal number each of number of todo_id, comments, ' +\
'and efforts inputs'
raise BadFormatException(msg)
+ for _ in [id_ for id_ in done_todos if id_ not in old_todos]:
+ raise BadFormatException('"done" field refers to unknown Todo')
+ #
day = Day.by_id_or_create(self._conn, date)
day.comment = day_comment
day.save(self._conn)
#
todo.set_condition_relations(self._conn, *cond_rels)
for child in [c for c in todo.children if c.id_ not in adoptees]:
- todo.remove_child(child)
+ todo.remove_child(child)
for child_id in [id_ for id_ in adoptees
if id_ not in [c.id_ for c in todo.children]]:
- todo.add_child(Todo.by_id(self._conn, child_id))
+ todo.add_child(Todo.by_id(self._conn, child_id))
todo.update_attrs(**to_update)
for approach, proc_ids in to_make.items():
for process_id in proc_ids: