mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-21 16:53:08 +02:00
TW-1666: import should reject invalid data
- Thanks to Daniel Shahaf.
This commit is contained in:
parent
d640fed3d4
commit
bc1aa0bc0f
11 changed files with 14 additions and 2 deletions
|
@ -125,6 +125,7 @@
|
||||||
David Patrick).
|
David Patrick).
|
||||||
- TW-1655 Inform "No changes made." when quitting early due to signal (thanks
|
- TW-1655 Inform "No changes made." when quitting early due to signal (thanks
|
||||||
to Daniel Shahaf).
|
to Daniel Shahaf).
|
||||||
|
- TW-1666 import should reject invalid data (thanks to Daniel Shahaf).
|
||||||
- Prevent potential task duplication during import for non-pending tasks.
|
- Prevent potential task duplication during import for non-pending tasks.
|
||||||
- Show the active context in "context list", if any is active.
|
- Show the active context in "context list", if any is active.
|
||||||
- Fix "task edit" dropping annotation text after newlines.
|
- Fix "task edit" dropping annotation text after newlines.
|
||||||
|
|
|
@ -178,7 +178,7 @@ Task::status Task::textToStatus (const std::string& input)
|
||||||
else if (input[0] == 'r') return Task::recurring;
|
else if (input[0] == 'r') return Task::recurring;
|
||||||
else if (input[0] == 'w') return Task::waiting;
|
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 */)
|
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
|
// 1) Provide missing attributes where possible
|
||||||
// Provide a UUID if necessary. Validate if present.
|
// Provide a UUID if necessary. Validate if present.
|
||||||
|
|
|
@ -753,6 +753,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "Keine Aufgaben."
|
#define STRING_FEEDBACK_NO_TASKS "Keine Aufgaben."
|
||||||
|
|
|
@ -751,6 +751,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "No tasks."
|
#define STRING_FEEDBACK_NO_TASKS "No tasks."
|
||||||
|
|
|
@ -753,6 +753,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "Nenia tasko."
|
#define STRING_FEEDBACK_NO_TASKS "Nenia tasko."
|
||||||
|
|
|
@ -765,6 +765,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "Ninguna tarea."
|
#define STRING_FEEDBACK_NO_TASKS "Ninguna tarea."
|
||||||
|
|
|
@ -753,6 +753,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "No tasks."
|
#define STRING_FEEDBACK_NO_TASKS "No tasks."
|
||||||
|
|
|
@ -752,6 +752,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "Nessun task."
|
#define STRING_FEEDBACK_NO_TASKS "Nessun task."
|
||||||
|
|
|
@ -753,6 +753,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "タスクがない。"
|
#define STRING_FEEDBACK_NO_TASKS "タスクがない。"
|
||||||
|
|
|
@ -753,6 +753,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "Brak zadań."
|
#define STRING_FEEDBACK_NO_TASKS "Brak zadań."
|
||||||
|
|
|
@ -753,6 +753,7 @@
|
||||||
#define STRING_ERROR_NO_FILTER "Command line filters are not supported by this command."
|
#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_NO_MODS "Command line modifications are not supported by this command."
|
||||||
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
#define STRING_ERROR_CONFIRM_SIGINT "Interrupted: No changes made."
|
||||||
|
#define STRING_ERROR_BAD_STATUS "The status '{1}' is not valid."
|
||||||
|
|
||||||
// Feedback
|
// Feedback
|
||||||
#define STRING_FEEDBACK_NO_TASKS "Nenhuma tarefa."
|
#define STRING_FEEDBACK_NO_TASKS "Nenhuma tarefa."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue