Ticket #1805 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Add DateTime type to the method match ofCPSDirectory.utils

Reported by: jrosa Assigned to: jrosa
Priority: P1 Milestone: CPS 3.4.4
Component: CPSDirectory Version: TRUNK
Severity: normal Keywords:
Cc:

Description

Hello everybody,

We have an instance of CPS 3.4.3 which uses CPSLDAPSetup, and we get an exception "iteration over non-sequence" when trying to use the search in the members directory.

After a little research we have done these modifications to the module CPSDirectory.utils.py and got rid of the exception:

Add the line to the top of the module

             from DateTime import DateTime

In the method "match", replace the line:

isinstance(searched, (basestring, int, long, NoneType)

for

isinstance(searched, (basestring, int, long, NoneType, DateTime)

The next link goes to the line (in TRAC) that should be modified:

http://svn.nuxeo.org/trac/pub/browser/CPS3/products/CPSDirectory/trunk/utils.py#L152

The reason to add the type DateTime? is because is used for the field last_login_time. We had some other ticket related to this field http://www.mail-archive.com/cps-devel@lists.nuxeo.com/msg01828.html

Change History

01/17/07 19:48:54 changed by jrosa

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [50846], [50847] and [50848].

I created the test for this ticket and run tests of CPSDirectory without errors:

./bin/zopectl test -m Products.CPSDirectory
Running tests via: /usr/bin/python /opt/zope2.9.4/bin/test.py -v --config-file /var/instances/cpstrunk/etc/zope.conf -m Products.CPSDirectory
Parsing /var/instances/cpstrunk/etc/zope.conf
Running tests at level 1
Running unit tests:
  Running:
    ..................................................
    .....................................................................
  Ran 119 tests with 0 failures and 0 errors in 3.149 seconds.
Running Products.CPSDefault.tests.CPSTestCase.CPSDefaultLayer tests:
  Set up Products.CPSDefault.tests.CPSTestCase.CPSZCMLLayer in 1.541 seconds.
  Set up Products.CPSDefault.tests.CPSTestCase.CPSDefaultLayer in 26.729 seconds.
  Running:
    .............
  Ran 13 tests with 0 failures and 0 errors in 0.721 seconds.
Tearing down left over layers:
  Tear down Products.CPSDefault.tests.CPSTestCase.CPSDefaultLayer in 0.000 seconds.
  Tear down Products.CPSDefault.tests.CPSTestCase.CPSZCMLLayer ... not supported
Total: 132 tests, 0 failures, 0 errors