From 97dfa586dea42d44ad8e1d9148547fd805abd046 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 2 Oct 2009 09:29:22 -0400 Subject: Make primary_key optional. The pwpolicy plugin doesn't have a primary key but can still take advantage of other parts of the framework. --- ipalib/crud.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ipalib') diff --git a/ipalib/crud.py b/ipalib/crud.py index 57a2c782f..6d1a87f32 100644 --- a/ipalib/crud.py +++ b/ipalib/crud.py @@ -29,7 +29,8 @@ class Create(frontend.Method): """ def get_args(self): - yield self.obj.primary_key.clone(attribute=True) + if self.obj.primary_key: + yield self.obj.primary_key.clone(attribute=True) def get_options(self): if self.extra_options_first: @@ -48,7 +49,8 @@ class PKQuery(frontend.Method): """ def get_args(self): - yield self.obj.primary_key.clone(attribute=True, query=True) + if self.obj.primary_key: + yield self.obj.primary_key.clone(attribute=True, query=True) -- cgit