Skip to content

Commit e67939b

Browse files
m-kuhnnyalldawson
authored andcommittedMar 6, 2018
Fix editing models with custom params
1 parent cb84b83 commit e67939b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎python/plugins/processing/modeler/ModelerParameterDefinitionDialog.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,14 @@ def accept(self):
400400
isinstance(self.param, QgsProcessingParameterCrs)):
401401
self.param = QgsProcessingParameterCrs(name, description, self.selector.crs().authid())
402402
else:
403-
paramTypeDef = QgsApplication.instance().processingRegistry().parameterType(self.paramType)
403+
if self.paramType:
404+
typeId = self.paramType
405+
else:
406+
typeId = self.param.type()
407+
408+
paramTypeDef = QgsApplication.instance().processingRegistry().parameterType(typeId)
404409
if not paramTypeDef:
405-
msg = self.tr('The parameter `{}` is not registered, are you missing a required plugin?'.format(self.paramType))
410+
msg = self.tr('The parameter `{}` is not registered, are you missing a required plugin?'.format(typeId))
406411
raise UndefinedParameterException(msg)
407412
self.param = paramTypeDef.create(name)
408413
self.param.setDescription(name)

0 commit comments

Comments
 (0)
Please sign in to comment.