Commit 257974be authored by Jérome Perrin's avatar Jérome Perrin

calendar: address pylint warnings

also rewrite a sorted to use key instead of cmp
parent 9c567e2e
......@@ -7,19 +7,15 @@ if object_path is None:
# Sometimes the object_path not comes with the request, when you edit for example.
object_path = request.get('URL1').split('/')[-1]
def sorted(seq, comparator):
new_seq = seq[::]
new_seq.sort(comparator)
return new_seq
def display_method(doc):
return doc.getTitle()
domain_list = []
organisation = context.organisation_module.restrictedTraverse(object_path)
for person in sorted(organisation.getSubordinationRelatedValueList(
portal_type='Person', checked_permission='View'),
lambda a, b: cmp(display_method(a), display_method(b))):
for person in sorted(
organisation.getSubordinationRelatedValueList(portal_type='Person', checked_permission='View'),
key=display_method):
domain = parent.generateTempDomain(id=person.getId())
domain.edit(title = display_method(person),
membership_criterion_base_category = ('source', 'destination'),
......
from Products.PythonScripts.standard import Object
request = container.REQUEST
portal = context.getPortalObject()
stool = portal.portal_simulation
......
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