Commit c8d3714f authored by Arnaud Fontaine's avatar Arnaud Fontaine

get(..., None) on a dict() is useless as get() returns None if the key cannot be found.

parent 7d39f342
......@@ -115,7 +115,7 @@ class ERP5User(PropertiedUser):
object_roles.remove('Developer')
product_config = getattr(getConfiguration(), 'product_config', None)
if product_config:
config = product_config.get('erp5', None)
config = product_config.get('erp5')
if config and self.getId() in config.developer_list:
return 1
......
......@@ -209,7 +209,7 @@ class ComponentDynamicPackage(ModuleType):
return None
for version in site.getVersionPriorityList():
component = component_version_dict.get(version, None)
component = component_version_dict.get(version)
if component is not None:
break
else:
......
......@@ -202,7 +202,7 @@ def generatePortalTypeClass(site, portal_type_name):
pass
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:
raise AttributeError('Document class %s has not been registered:'
' cannot import it as base of Portal Type %s'
......
......@@ -292,7 +292,7 @@ class ComponentMixin(PropertyRecordableMixin, Base):
self.dav__init(REQUEST, RESPONSE)
self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
text_content = REQUEST.get('BODY', None)
text_content = REQUEST.get('BODY')
if text_content is None:
RESPONSE.setStatus(304)
else:
......
......@@ -116,7 +116,7 @@ def allowed(self, object, object_roles=None ):
object_roles.remove('Developer')
product_config = getattr(getConfiguration(), 'product_config', None)
if product_config:
config = product_config.get('erp5', None)
config = product_config.get('erp5')
if config and self.getId() in config.developer_list:
return 1
......
......@@ -29,7 +29,7 @@ def allowed(self, object, object_roles=None):
object_roles.remove('Developer')
product_config = getattr(getConfiguration(), 'product_config', None)
if product_config:
config = product_config.get('erp5', None)
config = product_config.get('erp5')
if config and self.getId() in config.developer_list:
return 1
......@@ -50,7 +50,7 @@ def getRoles(self):
if role_tuple:
product_config = getattr(getConfiguration(), 'product_config', None)
if product_config:
config = product_config.get('erp5', None)
config = product_config.get('erp5')
if config:
role_set = set(role_tuple)
user_id = self.getId()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment