csv section import allows erroneous csv; creates sections that cannot be accessed (404) or deleted

Bug #1103897 reported by Lyla Fujiwara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool
Triaged
Medium
Douglas Cerna

Bug Description

When you import Section information you can put in an erroneous Schooltool ID for the section. It will create the Section without errors and display a link to it on the sections page. It will not actually let you access it or modify it when you click it, instead it will give a 404-esq page saying the section doesn’t exsist. I believe this is because the URL is not well formatted.

Example:
Tried to create (via import CSV) a section with school tool id “S5 Math (MPC/MCB/MPG) Term 1”. Either the / or the ( was the culprit because “S5 Math MPC MCB MPG Term 1” created the section normally.

As a side note, what I was really trying to do was not set the schooltool-id for the section, but rather the section title, via CSV. There doesn’t seem to be a way to do this with the import.

Tags: import
Revision history for this message
Tom Hoffman (tom-hoffman) wrote :

Hi Lyla,

The CSV importers in general are considered "mostly deprecated," and if they are buggy, we'll probably just remove them.

Is there some reason you were using CSV and not the .xls importer? Just that it was easier to find the link to the CSV?

Changed in schooltool:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Douglas Cerna (replaceafill)
Revision history for this message
Lyla Fujiwara (lyla-fujiwara) wrote :

Thank you for the fast response! Yes the xls looks like a better way to go.
As to why that wasn't my initial choice:
I'm trying to teach a not super tech savvy co-worker how to set up everything needed for a school year and do it in the most straight forward way possible. The import csv link for sections was the only way available, besides entering them by hand, when I was looking at the main section page.
I have used the xls import feature before, though in my mind (incorrectly) I assumed I should only be editing that sheet when initially setting up things for the school and that now that we're in our second year, it'd be risky to play around with such a comprehensive document. Also, when you click to import by csv, it gives you clear instructions/example of how to do it, whereas the xls import is something that I've mostly been editing by looking at what is automatically generated and copying it. At least to me, the existence of instructions and import csv link both implied that that csv import was the "proper" way to do it.
In retrospect, I think the csv import might have worked a little better in my situation as well because I could see my co-worker being overwhelmed by this giant excel sheet.
Finally, what would you recommend as the best way to remove the faulty sections? There's no way to go to their detail pages and doesn't seem to be anything other than options to add on the main screen. Is there any way to get rid of them short of changing things manually in the database? Thank you!

Revision history for this message
Lyla Fujiwara (lyla-fujiwara) wrote :
Download full text (12.6 KiB)

Also, not sure this is related, but now whenever I click on a user to go to their info page (or my own user page), I'm getting a server error. The only things I've changed intentionally are adding the messed up sections and using the import xls function to put some dummy data in for two new demographic fields (one a selection field, on a integer field)

Exception
TypeError: a float is required

Traceback
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 132, in publish
  result = publication.callObject(request, obj)
File "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py", line 207, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 107, in mapply
  return debug_call(obj, args)
Extra information: <schooltool.skin.flourish.zcml_content.FlourishPersonView_index.html object at 0x7f8f04b51e50>
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 113, in debug_call
  return obj(*args)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 81, in __call__
  result = self.render(*args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 74, in render
  return self.template(*args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/main.pt"
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 240, in __call__
  interpreter()
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 518, in do_optTag
  return self.no_tag(start, program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 513, in no_tag
  self.interpret(program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
  structure = self.engine.evaluateStructure(expr)
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/main.pt", line 79, column 8
  Expression: <PathExpr standard:u'view/page_template|nothing'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressi...

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.