Commit f40b2c66 authored by Jérome Perrin's avatar Jérome Perrin

km: fix pylint messages and enable coding style test

parent dc2da7fd
from Products.ERP5Type.Document import newTempBase from Products.ERP5Type.Document import newTempBase
request = context.REQUEST request = context.REQUEST
portal = context.getPortalObject()
# we can use current_web_document in case it's "embedded" into a Web Section # we can use current_web_document in case it's "embedded" into a Web Section
document = request.get('current_web_document', context) document = request.get('current_web_document', context)
......
...@@ -12,16 +12,16 @@ The parameters are ...@@ -12,16 +12,16 @@ The parameters are
base_category_list -- list of acceptable base categories base_category_list -- list of acceptable base categories
(used to filter part of the criteria) (used to filter part of the criteria)
user_name -- the user identifier (not used) user_name -- the user identifier (not used)
object -- object which we want to assign roles to obj -- object which we want to assign roles to
portal_type -- portal type of object portal_type -- portal type of object
""" """
category_list = [] category_list = []
if object is None: if obj is None:
return [] return []
criterion_list = object.getMembershipCriterionCategoryList() criterion_list = obj.getMembershipCriterionCategoryList()
for criterion in criterion_list: for criterion in criterion_list:
id_list = criterion.split('/') id_list = criterion.split('/')
base_category = id_list[0] base_category = id_list[0]
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>base_category_list, user_name, object, portal_type</string> </value> <value> <string>base_category_list, user_name, obj, portal_type</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
""" """
Create basic KM account using ERP5 credentials system. Create basic KM account using ERP5 credentials system.
""" """
from Products.Formulator.Errors import ValidationError, FormValidationError
portal = context.getPortalObject()
translateString = context.Base_translateString translateString = context.Base_translateString
website = context.getWebSiteValue() website = context.getWebSiteValue()
...@@ -12,7 +10,7 @@ result, result_type = context.Base_edit(form_id, silent_mode=1, field_prefix='yo ...@@ -12,7 +10,7 @@ result, result_type = context.Base_edit(form_id, silent_mode=1, field_prefix='yo
# Return if not appropriate # Return if not appropriate
if result_type != 'edit': if result_type != 'edit':
return result return result
kw, encapsulated_editor_list = result kw, _ = result
# XXX: hard coded due to erp5_credentials requirement # XXX: hard coded due to erp5_credentials requirement
kw['role_list'] = ['internal'] kw['role_list'] = ['internal']
......
...@@ -10,7 +10,7 @@ kw = {} ...@@ -10,7 +10,7 @@ kw = {}
try: try:
workflow_tool = context.portal_workflow workflow_tool = context.portal_workflow
workflow = getattr(workflow_tool, action['workflow_id']) workflow = getattr(workflow_tool, action['workflow_id'])
except: except AttributeError:
return {} return {}
# If this is a worklist action, read the worklist definition # If this is a worklist action, read the worklist definition
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>relation_id_list=[],**kw</string> </value> <value> <string>relation_id_list=(), **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
""" """
Returns a document by its reference in a gadget. Returns a document by its reference in a gadget.
""" """
request = context.REQUEST
portal = context.getPortalObject() portal = context.getPortalObject()
if box_relative_url: if box_relative_url:
......
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