Skip to content

Commit

Permalink
Fix editing models with custom params
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 6, 2018
1 parent cb84b83 commit e67939b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,14 @@ def accept(self):
isinstance(self.param, QgsProcessingParameterCrs)):
self.param = QgsProcessingParameterCrs(name, description, self.selector.crs().authid())
else:
paramTypeDef = QgsApplication.instance().processingRegistry().parameterType(self.paramType)
if self.paramType:
typeId = self.paramType
else:
typeId = self.param.type()

paramTypeDef = QgsApplication.instance().processingRegistry().parameterType(typeId)
if not paramTypeDef:
msg = self.tr('The parameter `{}` is not registered, are you missing a required plugin?'.format(self.paramType))
msg = self.tr('The parameter `{}` is not registered, are you missing a required plugin?'.format(typeId))
raise UndefinedParameterException(msg)
self.param = paramTypeDef.create(name)
self.param.setDescription(name)
Expand Down

0 comments on commit e67939b

Please sign in to comment.