diff --git a/ucs-4.0-1/management/univention-management-console/src/univention/management/console/protocol/session.py b/ucs-4.0-1/management/univention-management-console/src/univention/management/console/protocol/session.py index 18152a7..d4ebdd6 100644 --- a/ucs-4.0-1/management/univention-management-console/src/univention/management/console/protocol/session.py +++ b/ucs-4.0-1/management/univention-management-console/src/univention/management/console/protocol/session.py @@ -543,7 +543,9 @@ def _set_user_preferences(self, lo, preferences): if not self.__user_dn or not lo: return - old_preferences = lo.get(self.__user_dn, ['univentionUMCProperty']).get('univentionUMCProperty') + user = lo.get(self.__user_dn, ['univentionUMCProperty', 'objectClass']) + old_preferences = user.get('univentionUMCProperty') + object_classes = list(set(user.get('objectClass', [])) | {'univentionPerson',}) # validity / sanitizing new_preferences = [] @@ -559,7 +561,7 @@ def _set_user_preferences(self, lo, preferences): new_preferences.append((key, json.dumps(value))) new_preferences = ['%s=%s' % (key, value) for key, value in new_preferences] - lo.modify(self.__user_dn, [['univentionUMCProperty', old_preferences, new_preferences]]) + lo.modify(self.__user_dn, [['univentionUMCProperty', old_preferences, new_preferences], ['objectClass', user.get('objectClass', []), object_classes]]) def _get_user_favorites(self): favorites = set()