Skip to content
Permalink
Browse files

[Expression] Don't unregister function if not registering

  • Loading branch information
NathanW2 committed Nov 29, 2014
1 parent 7942325 commit 391d105ce007c56becc14b5966f481c7b0dc93fa
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/core/__init__.py
@@ -47,7 +47,8 @@ def func(self, values, feature, parent):
if arg_count == 0 and not name[0] == '$':
name = '${0}'.format(name)

if QgsExpression.isFunctionName(name):
register = kwargs.get('register', True)
if register and QgsExpression.isFunctionName(name):
if not QgsExpression.unregisterFunction(name):
raise TypeError("Unable to unregister function")

@@ -57,7 +58,6 @@ def func(self, values, feature, parent):

# This doesn't really make any sense here but does when used from a decorator context
# so it can stay.
register = kwargs.get('register', True)
if register:
QgsExpression.registerFunction(f)
return f

0 comments on commit 391d105

Please sign in to comment.
You can’t perform that action at this time.