From a479a4397bc0898180ef72ede2d72d0c8fb4ea3b Mon Sep 17 00:00:00 2001 From: Oscar Alvarez Date: Tue, 1 Sep 2015 23:30:06 -0500 Subject: [PATCH] Only to validate statements if these exists --- statement.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/statement.py b/statement.py index 8843bd5..cb74675 100644 --- a/statement.py +++ b/statement.py @@ -142,8 +142,8 @@ class OpenStatement(Wizard): def __setup__(cls): super(OpenStatement, cls).__setup__() cls._error_messages.update({ - 'open_statement': 'Statement %s opened.\n', - 'statement_already_opened': 'Statement %s already opened.\n', + 'open_statement': 'Statement %s opened. \n', + 'statement_already_opened': 'Statement %s already opened. \n', 'user_without_device': 'User %s has not any device assigned yet.' '\n', }) @@ -232,9 +232,9 @@ class CloseStatement(Wizard): def __setup__(cls): super(CloseStatement, cls).__setup__() cls._error_messages.update({ - 'close_statement': 'Statement %s closed.\n', - 'statement_already_closed': 'Statement %s already closed.\n', - 'not_statement_found': 'Statement %s not found.\n', + 'close_statement': 'Statement %s closed. \n', + 'statement_already_closed': 'Statement %s already closed. \n', + 'not_statement_found': 'Statement %s not found. \n', 'user_without_device': 'User %s has not any device assigned yet.' '\n', }) @@ -283,7 +283,8 @@ class CloseStatement(Wizard): result += self.raise_user_error('not_statement_found', error_args=(journal.rec_name,), raise_exception=False) - Statement.validate_statement(statements) + if statements: + Statement.validate_statement(statements) self.result = result else: self.result = self.raise_user_error('user_without_device',