Bug 51184

Summary: Traceback in UDM's DN encoders if list is empty
Product: UCS Reporter: Dirk Wiesenthal <wiesenthal>
Component: UDM (Generic)Assignee: Dirk Wiesenthal <wiesenthal>
Status: CLOSED FIXED QA Contact: Florian Best <best>
Severity: normal    
Priority: P5    
Version: UCS 4.4   
Target Milestone: UCS 4.4-4-errata   
Hardware: Other   
OS: Linux   
What kind of report is it?: Development Internal What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:
Bug Depends on:    
Bug Blocks: 51157    

Description Dirk Wiesenthal univentionstaff 2020-04-29 10:52:34 CEST
from univention.udm import *
udm = UDM.admin().version(2)
dn = ...
u = udm.get('users/user').get(dn)
u.props.secretary.objs
 
Results in
Traceback (most recent call last):
  File "t.py", line 4, in <module>
    u.props.secretary.objs
AttributeError: 'list' object has no attribute 'objs'


although the "secretary" property is defined as dn_list_property_encoder_for('users/user')


The problem occurs if there is no secretary information in LDAP, thus the value is None during decoding.
Comment 1 Dirk Wiesenthal univentionstaff 2020-05-03 16:13:50 CEST
Fixed in
  univention-directory-manager-modules (14.0.15-4)
Comment 2 Dirk Wiesenthal univentionstaff 2020-05-04 15:58:08 CEST
Added a test
  59_udm/60_udm_api_encoders.py
Comment 3 Florian Best univentionstaff 2020-05-05 14:17:40 CEST
OK: fix
OK: YAML
Comment 4 Erik Damrose univentionstaff 2020-05-06 14:40:03 CEST
<http://errata.software-univention.de/ucs/4.4/589.html>