summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/sudorule.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ipalib/plugins/sudorule.py b/ipalib/plugins/sudorule.py
index 9c2e7c51e..04ca97eff 100644
--- a/ipalib/plugins/sudorule.py
+++ b/ipalib/plugins/sudorule.py
@@ -310,10 +310,11 @@ class sudorule(LDAPObject):
)
def check_order_uniqueness(self, *keys, **options):
- if 'sudoorder' in options:
+ if options.get('sudoorder') is not None:
entries = self.methods.find(
sudoorder=options['sudoorder']
)['result']
+
if len(entries) > 0:
rule_name = entries[0]['cn'][0]
raise errors.ValidationError(