Skip to content

Commit

Permalink
[Processing][Modeler] Use default value instead of None
Browse files Browse the repository at this point in the history
In Modeler algorithm, when a algorithm's parameter was not defined it's value was set to None.
Before the possibility to defined optional parameters, None value is equal to set value to default one.
Now, it's important to use default value instead of None.
  • Loading branch information
rldhont committed Apr 28, 2016
1 parent 02a8333 commit d71742a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/modeler/ModelerAlgorithm.py
Expand Up @@ -379,7 +379,7 @@ def prepareAlgorithm(self, alg):
iface.messageBar().pushMessage(self.tr("Warning"),
self.tr("Parameter %s in algorithm %s in the model is run with default value! Edit the model to make sure that this is correct.") % (param.name, alg.name),
QgsMessageBar.WARNING, 4)
value = None
value = param.default
if value is None and isinstance(param, ParameterExtent):
value = self.getMinCoveringExtent()
# We allow unexistent filepaths, since that allows
Expand Down
Expand Up @@ -419,7 +419,7 @@ def setPreviousValues(self):
if param.name in alg.params:
value = alg.params[param.name]
else:
value = None
value = param.default
if isinstance(param, (
ParameterRaster,
ParameterVector,
Expand Down

0 comments on commit d71742a

Please sign in to comment.