Univention Bugzilla – Attachment 7612 Details for
Bug 41092
e-mail property contains previous address as default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
41092.patch (text/plain), 4.16 KB, created by
Florian Best
on 2016-04-21 15:54:02 CEST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-04-21 15:54:02 CEST
Size:
4.16 KB
patch
obsolete
>diff --git a/management/univention-directory-manager-modules/modules/univention/admin/__init__.py b/management/univention-directory-manager-modules/modules/univention/admin/__init__.py >index 4c8da83..ac2c80d 100644 >--- a/management/univention-directory-manager-modules/modules/univention/admin/__init__.py >+++ b/management/univention-directory-manager-modules/modules/univention/admin/__init__.py >@@ -33,6 +33,7 @@ > import types > import sys > import re >+import copy > import univention.config_registry > import univention.debug > >@@ -210,59 +211,60 @@ def new(self): > return None > > def _replace( self, res, object ): >- return pattern_replace( res, object ) >+ return pattern_replace( copy.copy(res), object ) > > def default(self, object): >+ base_default = copy.copy(self.base_default) > if not object.set_defaults: > if self.multivalue: > return [] > else: > return '' > >- if not self.base_default: >+ if not base_default: > return self.new() > >- if isinstance(self.base_default, (types.StringType, types.UnicodeType)): >- return self._replace(self.base_default, object) >+ if isinstance(base_default, (types.StringType, types.UnicodeType)): >+ return self._replace(base_default, object) > > # we can not import univention.admin.syntax here (recursive import) so we need to find another way to identify a complex syntax >- if getattr( self.syntax, 'subsyntaxes', None ) is not None and isinstance( self.base_default[ 0 ], ( list, tuple ) ) and not self.multivalue: >- return self.base_default[ 0 ] >+ if getattr( self.syntax, 'subsyntaxes', None ) is not None and isinstance( base_default[ 0 ], ( list, tuple ) ) and not self.multivalue: >+ return base_default[ 0 ] > # multivalue defaults will only be a part of templates, so not multivalue is the common way for modules >- elif (isinstance(self.base_default[0], (types.StringType, types.UnicodeType))) and not self.multivalue: >- res=self.base_default[0] >- for p in self.base_default[1]: >+ elif (isinstance(base_default[0], (types.StringType, types.UnicodeType))) and not self.multivalue: >+ res=base_default[0] >+ for p in base_default[1]: > if not object[p]: > return self.new() > res=res.replace('<'+p+'>', object[p]) > return res > >- elif (isinstance(self.base_default[0], (types.StringType, types.UnicodeType))): >- for i in range(0,len(self.base_default)): >- if isinstance(self.base_default[i], (types.StringType, types.UnicodeType)): >- self.base_default[i]=self._replace(self.base_default[i],object) >+ elif (isinstance(base_default[0], (types.StringType, types.UnicodeType))): >+ for i in range(0,len(base_default)): >+ if isinstance(base_default[i], (types.StringType, types.UnicodeType)): >+ base_default[i]=self._replace(base_default[i],object) > else: # must be a list of loaded custom attributes then, so we return it if it has content >- if len(self.base_default[i])>0: >- if self.multivalue and type(self.base_default[i]) != types.ListType: >- return [self.base_default[i]] >+ if len(base_default[i])>0: >+ if self.multivalue and type(base_default[i]) != types.ListType: >+ return [base_default[i]] > else: >- return self.base_default[i] >+ return base_default[i] > else: > # return the first element, this is only related to empty custom attributes which are loaded wrong, needs to be fixed elsewhere > if i>0: >- if self.multivalue and not isinstance(self.base_default[0], types.ListType): >- return [self.base_default[0]] >+ if self.multivalue and not isinstance(base_default[0], types.ListType): >+ return [base_default[0]] > else: >- return self.base_default[0] >+ return base_default[0] > else: > return self.new() >- return self.base_default >+ return base_default > >- elif isinstance(self.base_default[0], types.FunctionType) or callable( self.base_default[ 0 ] ): >- for p in self.base_default[1]: >+ elif isinstance(base_default[0], types.FunctionType) or callable( base_default[ 0 ] ): >+ for p in base_default[1]: > if not object[p]: > return self.new() >- return self.base_default[0](object, self.base_default[2]) >+ return base_default[0](object, base_default[2]) > else: > return self.new() >
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 41092
:
7609
|
7611
| 7612