Show placeholder label on invalid action classes
Instead of throwing an error a sample label of "Unknown action type" will be used and allow users to delete the unknown state action. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -400,7 +400,10 @@ class WorkflowStateAction(models.Model):
|
||||
return self.get_class()(form_data=self.loads())
|
||||
|
||||
def get_class_label(self):
|
||||
return self.get_class().label
|
||||
try:
|
||||
return self.get_class().label
|
||||
except ImportError:
|
||||
return _('Unknown action type')
|
||||
|
||||
def loads(self):
|
||||
return json.loads(self.action_data)
|
||||
|
||||
Reference in New Issue
Block a user