Univention Bugzilla – Attachment 5220 Details for
Bug 30991
Performance problem with many groups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
do not open() when not necessary
bug30991.patch (text/plain), 1.91 KB, created by
Dirk Wiesenthal
on 2013-05-10 20:11 CEST
(
hide
)
Description:
do not open() when not necessary
Filename:
MIME Type:
Creator:
Dirk Wiesenthal
Created:
2013-05-10 20:11 CEST
Size:
1.91 KB
patch
obsolete
>Index: umc/python/udm/udm_ldap.py >=================================================================== >--- umc/python/udm/udm_ldap.py (Revision 40329) >+++ umc/python/udm/udm_ldap.py (Arbeitskopie) >@@ -1068,28 +1068,43 @@ > def map_choices( obj_list ): > result = [] > for obj in obj_list: >- obj.open() >- >+ # first try it without obj.open() (expensive) >+ key = label = None > if syn.key == 'dn': > key = obj.dn >- else: >+ if syn.label == 'dn': >+ label = obj.dn >+ if key is None: > try: > key = syn.key % obj.info > except KeyError: >- # ignore the entry as the key is important for a selection, there >- # is no sensible fallback for the key (Bug #26994) >- continue >- if syn.label is None: >- label = udm_objects.description( obj ) >- elif syn.label == 'dn': >- label = obj.dn >- else: >+ # key is not yet in obj.info -> obj.open()! >+ pass >+ if label is None and syn.label is not None: > try: > label = syn.label % obj.info > except KeyError: >- # fallback to the default description as this is just what displayed >- # to the user (Bug #26994) >- label = udm_objects.description( obj ) >+ # key is not yet in obj.info -> obj.open()! >+ pass >+ if key is None or label is None: >+ obj.open() >+ if key is None: >+ try: >+ key = syn.key % obj.info >+ except KeyError: >+ # ignore the entry as the key is important for a selection, there >+ # is no sensible fallback for the key (Bug #26994) >+ continue >+ if label is None: >+ if syn.label is None: >+ label = udm_objects.description( obj ) >+ else: >+ try: >+ label = syn.label % obj.info >+ except KeyError: >+ # fallback to the default description as this is just what displayed >+ # to the user (Bug #26994) >+ label = udm_objects.description( obj ) > > result.append( (key, label) ) > return result
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 30991
:
5220
|
5221
|
5222
|
5223
|
5224