Univention Bugzilla – Bug 52038
ucschool.lib metaclass should find attributes in model mixin classes
Last modified: 2020-11-18 10:38:00 CET
When using mixin classes to extend the functionality of models in the ucsschool.lib, attributes (of type ucsschool.lib.models.attributes.Attribute) are ignored. Thus mixins classes can only contain methods but not the data they work on. This has led to the RoleSupportMixin mixin class requiring all of its clients (the inheriting classes) to define the same attribute. A new feature (Bug #52035) now wants to add a few attributes to selected classes, and again this cannot be done. Modify the meta programming in the ucschool.lib to allow mixins to add attributes to model classes.
In git branch dtroeder/52038_allow_attributes_in_mixins the commit implements this: 21a334562 Bug #52038: look for Attribute and Meta objects in all base classes Work has already been done (not yet commited) to cleanup the group changes for Bug #52035 and what's missing is to use this for base.RoleSupportMixin.
The above commit has been merged (only change: improved a comment). Additionally the email related work group attributes and the ucsschool_role attribute have been moved to separate mixin classes. [4.4] fa7784129 Bug #52038: look for Attribute and Meta objects in all base classes [4.4] 73b61f19b Bug #52038: move email related attributes to mixin class [4.4] 5b87b689d Bug #52038: move 'ucsschool_roles' attribute to mixin class [4.4] 3a12014cc Bug #52038: changelog and advisory [4.4] 9635e7415 Bug #52038: advisory update ucs-school-lib (12.2.1)
Changelog&Advisory: OK Manual tests: OK Automatic tests: NOT OK - The jenkins tests are broken at the moment, so I cannot VERIFY this bug until the tests are working again.
Though still not fixed the Jenkins tests ran the relevant tests for this bug and thus I can VERIFIY it.
UCS@school 4.4 v8 has been released (errata update to the release). https://docs.software-univention.de/changelog-ucsschool-4.4v8-de.html If this error occurs again, please clone this bug.