The box_labels.py script fails when attempting to get sub containers. I thought it was failing because of digital objects, but the try on line 56 should catch that.
To reproduce
Steps to reproduce the behavior:
Download latest version of script
Run it against a finding aid id 12111
Expected behavior
Get a list of container labels. Script runs successfully.
Error message or screenshots
Administrators-MacBook-Pro:archivessnake pgalligan$ sudo python3 get_labels.py 12111
Traceback (most recent call last):
File "get_labels.py", line 77, in
LabelPrinter(args.resource).run()
File "get_labels.py", line 23, in run
container = self.get_containers(obj)
File "get_labels.py", line 57, in get_containers
top_container = instance.sub_container.top_container
File "/usr/local/lib/python3.7/site-packages/asnake/jsonmodel/init.py", line 180, in getattr
if isinstance(self._json[key], list) and len(self._json[key]) > 0:
KeyError: 'sub_container'
Describe the bug
The box_labels.py script fails when attempting to get sub containers. I thought it was failing because of digital objects, but the try on line 56 should catch that.
To reproduce
Steps to reproduce the behavior:
Expected behavior
Get a list of container labels. Script runs successfully.
Error message or screenshots
Administrators-MacBook-Pro:archivessnake pgalligan$ sudo python3 get_labels.py 12111 Traceback (most recent call last): File "get_labels.py", line 77, in
LabelPrinter(args.resource).run()
File "get_labels.py", line 23, in run
container = self.get_containers(obj)
File "get_labels.py", line 57, in get_containers
top_container = instance.sub_container.top_container
File "/usr/local/lib/python3.7/site-packages/asnake/jsonmodel/init.py", line 180, in getattr
if isinstance(self._json[key], list) and len(self._json[key]) > 0:
KeyError: 'sub_container'