Bug 54694 - [4.4] ucsschool.lib drops one OU when adding and removing a school to/from a user at the same time
[4.4] ucsschool.lib drops one OU when adding and removing a school to/from a ...
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: Ucsschool-lib
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on: 54690
Blocks:
  Show dependency treegraph
 
Reported: 2022-04-27 13:17 CEST by Daniel Tröder
Modified: 2022-04-27 13:17 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.057
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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2022-04-27 13:17:25 CEST
Backport the fix from Bug 54690 to UCS@school 4.4.

======================================================================

+++ This bug was initially created as a clone of Bug #54690 +++

When a user has 2 OUs and in a modify operation one is removed and another is added, the additional OU is later missing in the "schools" attribute:

--------------------------------------------------------------------------------
user = Student(name="stud9", school="DEMOSCHOOL", schools=["DEMOSCHOOL", "school1"], firstname='James9', lastname='Bond9', school_classes={'DEMOSCHOOL': ['ds'], 'school1': ['s1']})
user.create(lo)

user.schools = ["DEMOSCHOOL", "school2"]
user.school_classes={'DEMOSCHOOL': ['ds'], 'school2': ['s2']}
user.modify(lo)

print("school={!r} schools={!r} school_classes={!r}".format(user.school, user.schools, user.school_classes))

→ school=u'DEMOSCHOOL' schools=[u'DEMOSCHOOL'] school_classes={'school2': ['s2'], 'DEMOSCHOOL': ['ds']}

--------------------------- validation -----------------------------------------
... UCS@school Object ... with options {...} has validation errors:
	- is not part of schools: ['school2'].
--------------------------------------------------------------------------------

Fix the ucsschool.lib in to contain all OUs in the "schools" attribute.