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): ...@@ -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
......
...@@ -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:
......
...@@ -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'
......
...@@ -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:
......
...@@ -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
......
...@@ -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()
......
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