Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
erp5
Commits
c8d3714f
Commit
c8d3714f
authored
Mar 01, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get(..., None) on a dict() is useless as get() returns None if the key cannot be found.
parent
7d39f342
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
product/ERP5Security/ERP5UserFactory.py
product/ERP5Security/ERP5UserFactory.py
+1
-1
product/ERP5Type/dynamic/component_package.py
product/ERP5Type/dynamic/component_package.py
+1
-1
product/ERP5Type/dynamic/portal_type_class.py
product/ERP5Type/dynamic/portal_type_class.py
+1
-1
product/ERP5Type/mixin/component.py
product/ERP5Type/mixin/component.py
+1
-1
product/ERP5Type/patches/PropertiedUser.py
product/ERP5Type/patches/PropertiedUser.py
+1
-1
product/ERP5Type/patches/User.py
product/ERP5Type/patches/User.py
+2
-2
No files found.
product/ERP5Security/ERP5UserFactory.py
View file @
c8d3714f
...
@@ -115,7 +115,7 @@ class ERP5User(PropertiedUser):
...
@@ -115,7 +115,7 @@ class ERP5User(PropertiedUser):
object_roles
.
remove
(
'Developer'
)
object_roles
.
remove
(
'Developer'
)
product_config
=
getattr
(
getConfiguration
(),
'product_config'
,
None
)
product_config
=
getattr
(
getConfiguration
(),
'product_config'
,
None
)
if
product_config
:
if
product_config
:
config
=
product_config
.
get
(
'erp5'
,
None
)
config
=
product_config
.
get
(
'erp5'
)
if
config
and
self
.
getId
()
in
config
.
developer_list
:
if
config
and
self
.
getId
()
in
config
.
developer_list
:
return
1
return
1
...
...
product/ERP5Type/dynamic/component_package.py
View file @
c8d3714f
...
@@ -209,7 +209,7 @@ class ComponentDynamicPackage(ModuleType):
...
@@ -209,7 +209,7 @@ class ComponentDynamicPackage(ModuleType):
return
None
return
None
for
version
in
site
.
getVersionPriorityList
():
for
version
in
site
.
getVersionPriorityList
():
component
=
component_version_dict
.
get
(
version
,
None
)
component
=
component_version_dict
.
get
(
version
)
if
component
is
not
None
:
if
component
is
not
None
:
break
break
else
:
else
:
...
...
product/ERP5Type/dynamic/portal_type_class.py
View file @
c8d3714f
...
@@ -202,7 +202,7 @@ def generatePortalTypeClass(site, portal_type_name):
...
@@ -202,7 +202,7 @@ def generatePortalTypeClass(site, portal_type_name):
pass
pass
if
klass
is
None
:
if
klass
is
None
:
type_class_path
=
document_class_registry
.
get
(
type_class
,
None
)
type_class_path
=
document_class_registry
.
get
(
type_class
)
if
type_class_path
is
None
:
if
type_class_path
is
None
:
raise
AttributeError
(
'Document class %s has not been registered:'
raise
AttributeError
(
'Document class %s has not been registered:'
' cannot import it as base of Portal Type %s'
' cannot import it as base of Portal Type %s'
...
...
product/ERP5Type/mixin/component.py
View file @
c8d3714f
...
@@ -292,7 +292,7 @@ class ComponentMixin(PropertyRecordableMixin, Base):
...
@@ -292,7 +292,7 @@ class ComponentMixin(PropertyRecordableMixin, Base):
self
.
dav__init
(
REQUEST
,
RESPONSE
)
self
.
dav__init
(
REQUEST
,
RESPONSE
)
self
.
dav__simpleifhandler
(
REQUEST
,
RESPONSE
,
refresh
=
1
)
self
.
dav__simpleifhandler
(
REQUEST
,
RESPONSE
,
refresh
=
1
)
text_content
=
REQUEST
.
get
(
'BODY'
,
None
)
text_content
=
REQUEST
.
get
(
'BODY'
)
if
text_content
is
None
:
if
text_content
is
None
:
RESPONSE
.
setStatus
(
304
)
RESPONSE
.
setStatus
(
304
)
else
:
else
:
...
...
product/ERP5Type/patches/PropertiedUser.py
View file @
c8d3714f
...
@@ -116,7 +116,7 @@ def allowed(self, object, object_roles=None ):
...
@@ -116,7 +116,7 @@ def allowed(self, object, object_roles=None ):
object_roles
.
remove
(
'Developer'
)
object_roles
.
remove
(
'Developer'
)
product_config
=
getattr
(
getConfiguration
(),
'product_config'
,
None
)
product_config
=
getattr
(
getConfiguration
(),
'product_config'
,
None
)
if
product_config
:
if
product_config
:
config
=
product_config
.
get
(
'erp5'
,
None
)
config
=
product_config
.
get
(
'erp5'
)
if
config
and
self
.
getId
()
in
config
.
developer_list
:
if
config
and
self
.
getId
()
in
config
.
developer_list
:
return
1
return
1
...
...
product/ERP5Type/patches/User.py
View file @
c8d3714f
...
@@ -29,7 +29,7 @@ def allowed(self, object, object_roles=None):
...
@@ -29,7 +29,7 @@ def allowed(self, object, object_roles=None):
object_roles
.
remove
(
'Developer'
)
object_roles
.
remove
(
'Developer'
)
product_config
=
getattr
(
getConfiguration
(),
'product_config'
,
None
)
product_config
=
getattr
(
getConfiguration
(),
'product_config'
,
None
)
if
product_config
:
if
product_config
:
config
=
product_config
.
get
(
'erp5'
,
None
)
config
=
product_config
.
get
(
'erp5'
)
if
config
and
self
.
getId
()
in
config
.
developer_list
:
if
config
and
self
.
getId
()
in
config
.
developer_list
:
return
1
return
1
...
@@ -50,7 +50,7 @@ def getRoles(self):
...
@@ -50,7 +50,7 @@ def getRoles(self):
if
role_tuple
:
if
role_tuple
:
product_config
=
getattr
(
getConfiguration
(),
'product_config'
,
None
)
product_config
=
getattr
(
getConfiguration
(),
'product_config'
,
None
)
if
product_config
:
if
product_config
:
config
=
product_config
.
get
(
'erp5'
,
None
)
config
=
product_config
.
get
(
'erp5'
)
if
config
:
if
config
:
role_set
=
set
(
role_tuple
)
role_set
=
set
(
role_tuple
)
user_id
=
self
.
getId
()
user_id
=
self
.
getId
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment