commit c5ad0b4bafd579fdc2fa5bd1b190d99b22722982 Author: Dirk Wiesenthal <wiesenthal@univention.de> Date: Wed Apr 5 16:01:44 2023 +0200 Fix section error in the UMC software packages module diff --git management/univention-appcenter/umc/python/appcenter/__init__.py management/univention-appcenter/umc/python/appcenter/__init__.py index 5aa50934e4..ea5d3b1991 100644 --- management/univention-appcenter/umc/python/appcenter/__init__.py +++ management/univention-appcenter/umc/python/appcenter/__init__.py @@ -599,7 +599,8 @@ class Instance(umcm.Base, ProgressMixin): sections = set() cache = apt.Cache() for package in cache: - sections.add(package.section) + if package.candidate: + sections.add(package.candidate.section) return sorted(sections) @@ -609,7 +610,7 @@ class Instance(umcm.Base, ProgressMixin): """Query to fill the grid. Structure is fixed here.""" result = [] for package in self.package_manager.packages(reopen=True): - if section == 'all' or package.section == section: + if section == 'all' or package.candidate and package.candidate.section == section: toshow = False if pattern.pattern == '^.*$': toshow = True @@ -753,7 +754,7 @@ class Instance(umcm.Base, ProgressMixin): if full: # Some fields differ depending on whether the package is installed or not: if package.is_installed: - result['section'] = installed.section + result['section'] = candidate.section result['priority'] = installed.priority or '' result['summary'] = installed.summary # take the current one result['description'] = installed.description
Already happens in UCS 5.1: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 360, in __error_handling six.reraise(etype, exc, etraceback) File "/usr/lib/python3/dist-packages/six.py", line 719, in reraise raise value File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 260, in execute function.__func__(self, request, *args, **kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 478, in _response result = _multi_response(self, request) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 189, in _response return function(self, request) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 602, in _response return list(function(self, iterator, *nones)) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 444, in _fake_func yield function(self, *args) File "/usr/lib/python3/dist-packages/univention/management/console/modules/appcenter/__init__.py", line 602, in packages_sections sections.add(package.section) AttributeError: 'Package' object has no attribute 'section'
Package: univention-appcenter Version: 9.100.0-1A~5.2.0.202310102121 Branch: ucs_5.2-0
OK: changes already in UCS 5.1 OK: no error anymore OK: changelog entry
univention-appcenter (10.0.7) 05cfd131e383 | fix(appcenter): adjust section error in the UMC software packages module