Only to validate statements if these exists
This commit is contained in:
parent
84e520771c
commit
a479a4397b
13
statement.py
13
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',
|
||||
|
Loading…
Reference in New Issue
Block a user