TW-1666: import should reject invalid data

- Thanks to Daniel Shahaf.
This commit is contained in:
Paul Beckingham 2015-08-22 12:34:10 -04:00
parent d640fed3d4
commit bc1aa0bc0f
11 changed files with 14 additions and 2 deletions

View file

@ -125,6 +125,7 @@
David Patrick).
- TW-1655 Inform "No changes made." when quitting early due to signal (thanks
to Daniel Shahaf).
- TW-1666 import should reject invalid data (thanks to Daniel Shahaf).
- Prevent potential task duplication during import for non-pending tasks.
- Show the active context in "context list", if any is active.
- Fix "task edit" dropping annotation text after newlines.

View file

@ -178,7 +178,7 @@ Task::status Task::textToStatus (const std::string& input)
else if (input[0] == 'r') return Task::recurring;
else if (input[0] == 'w') return Task::waiting;
return Task::pending;
throw format (STRING_ERROR_BAD_STATUS, input);
}
////////////////////////////////////////////////////////////////////////////////
@ -1401,7 +1401,9 @@ void Task::substitute (
//
void Task::validate (bool applyDefault /* = true */)
{
Task::status status = getStatus ();
Task::status status = Task::pending;
if (get ("status") != "")
status = getStatus ();
// 1) Provide missing attributes where possible
// Provide a UUID if necessary. Validate if present.

View file

@ -753,6 +753,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "Keine Aufgaben."

View file

@ -751,6 +751,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "No tasks."

View file

@ -753,6 +753,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "Nenia tasko."

View file

@ -765,6 +765,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "Ninguna tarea."

View file

@ -753,6 +753,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "No tasks."

View file

@ -752,6 +752,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "Nessun task."

View file

@ -753,6 +753,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "タスクがない。"

View file

@ -753,6 +753,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "Brak zadań."

View file

@ -753,6 +753,7 @@
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
#define STRING_ERROR_NO_MODS "Command line modifications are not supported by this command."
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
// Feedback
#define STRING_FEEDBACK_NO_TASKS "Nenhuma tarefa."