diff options
Diffstat (limited to 'ipalib/plugins')
-rw-r--r-- | ipalib/plugins/user.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ipalib/plugins/user.py b/ipalib/plugins/user.py index f76fbd630..620975496 100644 --- a/ipalib/plugins/user.py +++ b/ipalib/plugins/user.py @@ -227,7 +227,13 @@ class user_add(LDAPCreate): config = ldap.get_ipa_config()[1] if 'ipamaxusernamelength' in config: if len(keys[-1]) > int(config.get('ipamaxusernamelength')[0]): - raise errors.ValidationError(name='uid', error=_('can be at most %(len)d characters' % dict(len = int(config.get('ipamaxusernamelength')[0])))) + raise errors.ValidationError( + name=self.obj.primary_key.cli_name, error=_( + 'can be at most %(len)d characters' % dict( + len = int(config.get('ipamaxusernamelength')[0]) + ) + ) + ) entry_attrs.setdefault('loginshell', config.get('ipadefaultloginshell')) # hack so we can request separate first and last name in CLI full_name = '%s %s' % (entry_attrs['givenname'], entry_attrs['sn']) |