Don't execute document renaming if there is workflow action is not configured.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -49,6 +49,8 @@ class DocumentPropertiesEditAction(WorkflowAction):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
self.document_label = self.form_data.get('document_label')
|
self.document_label = self.form_data.get('document_label')
|
||||||
self.document_description = self.form_data.get('document_description')
|
self.document_description = self.form_data.get('document_description')
|
||||||
|
new_label = None
|
||||||
|
new_description = None
|
||||||
|
|
||||||
if self.document_label:
|
if self.document_label:
|
||||||
try:
|
try:
|
||||||
@@ -74,9 +76,11 @@ class DocumentPropertiesEditAction(WorkflowAction):
|
|||||||
|
|
||||||
logger.debug('Document description template result: %s', new_description)
|
logger.debug('Document description template result: %s', new_description)
|
||||||
|
|
||||||
|
if new_label or new_description:
|
||||||
document = context['document']
|
document = context['document']
|
||||||
document.label = new_label
|
document.label = new_label or document.label
|
||||||
document.description = new_description
|
document.description = new_description or document.description
|
||||||
|
|
||||||
document.save()
|
document.save()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user