projects
/
Plinn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a6d541b
)
Bugfix : à l'instanciation d'un site CMF, le composant Products.CMFCore.interfaces...
author
Benoît Pin
<pin@cri.ensmp.fr>
Fri, 10 Oct 2014 13:04:43 +0000
(15:04 +0200)
committer
Benoît Pin
<pin@cri.ensmp.fr>
Fri, 10 Oct 2014 13:04:43 +0000
(15:04 +0200)
userlanguages.py
patch
|
blob
|
history
diff --git
a/userlanguages.py
b/userlanguages.py
index
40fca2a
..
d108c40
100644
(file)
--- a/
userlanguages.py
+++ b/
userlanguages.py
@@
-1,11
+1,15
@@
# -*- coding: utf-8 -*-
from zope.publisher.browser import BrowserLanguages
from Products.CMFCore.utils import getUtilityByInterfaceName
# -*- coding: utf-8 -*-
from zope.publisher.browser import BrowserLanguages
from Products.CMFCore.utils import getUtilityByInterfaceName
+from zope.component.interfaces import ComponentLookupError
class AuthenticatedUserLanguages(BrowserLanguages):
def getPreferredLanguages(self) :
class AuthenticatedUserLanguages(BrowserLanguages):
def getPreferredLanguages(self) :
- mtool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IMembershipTool')
+ try :
+ mtool = getUtilityByInterfaceName('Products.CMFCore.interfaces.IMembershipTool')
+ except ComponentLookupError :
+ return super(AuthenticatedUserLanguages, self).getPreferredLanguages()
if mtool.isAnonymousUser() :
return super(AuthenticatedUserLanguages, self).getPreferredLanguages()
else :
if mtool.isAnonymousUser() :
return super(AuthenticatedUserLanguages, self).getPreferredLanguages()
else :