On to, 02 kesä 2022, Leo O via FreeIPA-users wrote:
Okay it worked, the ui fields appeared finally.

But there is still an issue. When I now e.g. click on the checkbox "Mail 
enabled" and save it, I get an error:
"IPA Error 4002: DuplicateEntry" - "Type or value exists".

Looked through the logs, but couldn't find anything useful, which points me 
into a direction.

Enable debug in /etc/ipa/server.conf
[global]
debug=True

and restart httpd, then re-try. /var/log/httpd/error_log will have more
details.

I suspect these are from your unguarded appends:

def usermod_precallback(self, ldap, dn, entry, attrs_list, *keys, **options):

    if "objectclass" not in entry.keys():
        old_entry = ldap.get_entry(dn, ["objectclass"])
        entry["objectclass"] = old_entry["objectclass"]
    entry["objectclass"].append("postfixbookmailaccount")
    return dn

instead of that, simply use add_missing_object_class(). This is how it
is done in user-add-certmapdata, for example:

from .baseldap import add_missing_object_class

class baseuser_add_certmapdata(ModCertMapData, LDAPAddAttribute):
    __doc__ = _("Add one or more certificate mappings to the user entry.")
    msg_summary = _('Added certificate mappings to user "%(value)s"')

    def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys,
                     **options):

        dn = super(baseuser_add_certmapdata, self).pre_callback(
            ldap, dn, entry_attrs, attrs_list, *keys, **options)

        # The objectclass ipacertmapobject may not be present on
        # existing user entries. We need to add it if we define a new
        # value for ipacertmapdata
        add_missing_object_class(ldap, u'ipacertmapobject', dn)

        return dn


--
/ Alexander Bokovoy
Sr. Principal Software Engineer
Security / Identity Management Engineering
Red Hat Limited, Finland
_______________________________________________
FreeIPA-users mailing list -- freeipa-users@lists.fedorahosted.org
To unsubscribe send an email to freeipa-users-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to