Skip to content

get_seed_metadata fails if called in the wrong order #6

Description

@shawnmjones

The following function assumes that a user will have called function load_seed_metadata before calling get_seed_metadata.

https://github.com/oduwsdl/archiveit_utilities/blob/bdaa349623705dc2c70e1dc17316d8b433327e5b/aiu/archiveit_collection.py#L507-L513

If called in the wrong order, then get_seed_metadata throws the following exception.

Traceback (most recent call last):
  File "/Users/smj/Unsynced-Projects/MementoEmbed/mementoembed/services/errors.py", line 27, in handle_errors
    return function_name(urim, preferences)
  File "/Users/smj/Unsynced-Projects/MementoEmbed/mementoembed/services/memento.py", line 195, in seeddata
    output[\'metadata\'] = sr.seed_metadata()
  File "/Users/smj/Unsynced-Projects/MementoEmbed/mementoembed/seedresource.py", line 152, in seed_metadata
    metadata = self.aic.get_seed_metadata(self.urir)[\'collection_web_pages\']
  File "/Users/smj/.virtualenvs/MementoEmbed/lib/python3.7/site-packages/aiu/archiveit_collection.py", line 506, in get_seed_metadata
    d = self.seed_metadata["seeds"][uri]
KeyError: 'seeds'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions