Univention Bugzilla – Attachment 5488 Details for
Bug 32781
modules/univention/admin/modules.py: pos undefined, unstable sort
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix syntax error
32781_udm-ea-priority.diff (text/plain), 2.38 KB, created by
Philipp Hahn
on 2013-10-01 16:04:56 CEST
(
hide
)
Description:
Fix syntax error
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2013-10-01 16:04:56 CEST
Size:
2.38 KB
patch
obsolete
>diff --git a/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admin/modules.py b/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admin/modules.py >index a011ab4..0335ade 100644 >--- a/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admin/modules.py >+++ b/branches/ucs-3.2/ucs-3.2-0/management/univention-directory-manager-modules/modules/univention/admin/modules.py >@@ -371,15 +371,7 @@ class EA_Layout( dict ): > return self.get( 'advanced', False ) > > def __cmp__( self, other ): >- if self.groupName < other.groupName: >- return -1 >- if other.groupName < self.groupName: >- return 1 >- if self.position < other.position: >- return -1 >- if other.position < self.position: >- return 1 >- return 0 >+ return cmp(self.groupName, other.groupName) or cmp(self.position, other.position) > > def update_extended_attributes(lo, module, position): > >@@ -531,14 +523,7 @@ def update_extended_attributes(lo, module, position): > tabPosition = -1 > > if tabPosition == -1: >- for ea_layout in properties4tabs[ tabname ]: >- try: >- if ea_layout.position <= tabPosition: >- # CLEANUP, FIXME: pos is undefined! >- # does not break because of except: >- tabPosition = pos-1 >- except: >- ud.debug(ud.ADMIN, ud.WARN, 'modules update_extended_attributes: custom field for tab %s: failed to set tabPosition' % tabname) >+ tabPosition = min((ea_layout.position for ea_layout in properties4tabs[tabname])) - 1 > > properties4tabs[ tabname ].append( EA_Layout( name = pname, tabName = tabname, position = tabPosition, advanced = tabAdvanced, overwrite = overwriteProp, fullWidth = fullWidth, groupName = groupname, groupPosition = groupPosition ) ) > >@@ -553,16 +538,13 @@ def update_extended_attributes(lo, module, position): > overwriteTabList.append(tab) > > if properties4tabs: >- lastprio = -1000 # CLEANUP: unneeded >- > # remove layout of tabs that have been marked for replacement > removetab = [] # CLEANUP: unneeded > for tab in module.layout: > if tab.label in overwriteTabList: > tab.layout = [] > >- for tabname in properties4tabs.keys(): >- priofields = properties4tabs[ tabname ] >+ for tabname, priofields in properties4tabs.items(): > priofields.sort() > currentTab = None > # get existing fields if tab has not been overwritten
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32781
: 5488