comses / catalog

Web tools to annotate publications related to computational modeling
http://catalog.comses.net
GNU General Public License v3.0
3 stars 3 forks source link

zotero import dies on bad input #16

Closed alee closed 9 years ago

alee commented 9 years ago

I'm not sure if the collection syntax is correct - another issue is that the tool says it is pulling 614 publications but it should only be pulling 544 from https://www.zotero.org/groups/workbench-cml/items/collectionKey/7DQ82DZ3

alllee% ./manage.py zotero_import --group=289063 --collection=7DQ82DZ3
Starting to import data from Zotero. Hang tight, this may take a while.
Number of Publications to import: 614
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/alllee/.virtualenvs/catalog/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/home/alllee/.virtualenvs/catalog/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/alllee/.virtualenvs/catalog/local/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/alllee/.virtualenvs/catalog/local/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "/home/alllee/work/comses/catalog/catalog/core/management/commands/zotero_import.py", line 235, in handle
    self.generate_entry(json_data)
  File "/home/alllee/work/comses/catalog/catalog/core/management/commands/zotero_import.py", line 214, in generate_entry
    note = self.create_note(item['data'], item['meta'])
  File "/home/alllee/work/comses/catalog/catalog/core/management/commands/zotero_import.py", line 197, in create_note
    item.added_by = self.get_user(meta)
  File "/home/alllee/work/comses/catalog/catalog/core/management/commands/zotero_import.py", line 50, in get_user
    first_name, last_name = meta_data['createdByUser']['name'].strip().split(' ')
ValueError: need more than 1 value to unpack