persons/@@person-csvimport.html error

Bug #80014 reported by Robert Jones
14
Affects Status Importance Assigned to Milestone
SchoolTool
Fix Released
Medium
Unassigned

Bug Description

SVN checkout of SchoolTool. Trying to import the attached cvs of persons
produced this error:

File "/home/jonesieboy/schooltool/Zope3/src/zope/publisher/publish.py", line
138, in publish
  result = publication.callObject(request, object)
File
"/home/jonesieboy/schooltool/Zope3/src/zope/app/publication/zopepublication.py",
line 164, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/home/jonesieboy/schooltool/Zope3/src/zope/publisher/publish.py", line
113, in mapply
  return debug_call(object, args)
Extra information: <zope.app.pagetemplate.simpleviewclass.SimpleViewClass from
/home/jonesieboy/schooltool/src/schooltool/browser/templates/person-csvimport.pt
object at 0xb07ba9ec>
File "/home/jonesieboy/schooltool/Zope3/src/zope/publisher/publish.py", line
119, in debug_call
  return object(*args)
File
"/home/jonesieboy/schooltool/Zope3/src/zope/app/pagetemplate/simpleviewclass.py",
line 44, in __call__
  return self.index(*args, **kw)
File
"/home/jonesieboy/schooltool/Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py",
line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File
"/home/jonesieboy/schooltool/Zope3/src/zope/app/pagetemplate/viewpagetemplatefile.py",
line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/home/jonesieboy/schooltool/Zope3/src/zope/pagetemplate/pagetemplate.py",
line 117, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations)()
Template
"/home/jonesieboy/schooltool/src/schooltool/browser/templates/person-csvimport.pt"
File "/home/jonesieboy/schooltool/Zope3/src/zope/tal/talinterpreter.py", line
239, in __call__
  self.interpret(self.program)
File "/home/jonesieboy/schooltool/Zope3/src/zope/tal/talinterpreter.py", line
314, in interpret
  handlers[opcode](self, args)
File "/home/jonesieboy/schooltool/Zope3/src/zope/tal/talinterpreter.py", line
552, in do_setLocal_tal
  self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/home/jonesieboy/schooltool/Zope3/src/zope/tales/tales.py", line 698, in
evaluate
  return expression(self)
Template
"/home/jonesieboy/schooltool/src/schooltool/browser/templates/person-csvimport.pt",
line 1, column 0
  Expression: <PathExpr standard:u'view/update'>
File "/home/jonesieboy/schooltool/Zope3/src/zope/tales/expressions.py", line
204, in __call__
  return self._eval(econtext)
File "/home/jonesieboy/schooltool/Zope3/src/zope/tales/expressions.py", line
198, in _eval
  return ob()
File "/home/jonesieboy/schooltool/src/schoolbell/app/browser/csvimport.py", line
73, in update
  ok = self.importer.importFromCSV(csvfile)
File "/home/jonesieboy/schooltool/src/schoolbell/app/browser/csvimport.py", line
184, in importFromCSV
  assert dry_run, ("Something bad happened,"

Revision history for this message
Robert Jones (jonesieboy) wrote :
Revision history for this message
Robert Jones (jonesieboy) wrote :

The import works fine with this reduced csv (not cvs, as I called it originally
:) ). Schools will need to be able to import large numbers of users.

Revision history for this message
Brian Skahan (bskahan-deactivatedaccount) wrote :

Recreated this bug. It's caused by duplicate usernames:

RossJami,Jamie Ross
RossJami,Jamie Ross

What's the correct behavior here?
a) Dry run the whole file and report the duplicates.
b) Import the first occurences, drop the duplicates and report them as error.
c) Import first occurence, send the second occurence through the NameChooser,
report the changes as warnings.

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

I think that a) 'Dry run the whole file and report the duplicates' would be nicest.

Revision history for this message
Brian Skahan (bskahan-deactivatedaccount) wrote :

This should be fixed in r4664

Revision history for this message
Gintautas Miliauskas (gintas) wrote :

Backported.

I believe you have implemented b). I would prefer a), so I'm marking this done-cbb.

Revision history for this message
Brian Skahan (bskahan-deactivatedaccount) wrote :

I did go with b), that seemed more consistent with the behavior of the CSV
importers warnings and errors. I'd prefer c) over a or b in the end.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.