carj / pyPreservica

Python language binding for the Preservica API
https://pypreservica.readthedocs.io
Apache License 2.0
15 stars 2 forks source link

Retention API - NoneType object has no attribute 'text' #13

Closed UARM-Digital closed 1 year ago

UARM-Digital commented 1 year ago

Hey, I'm getting an error using the API.

Traceback (most recent call last):
    for policy in retention. Policies():
                  ^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pyPreservica\retentionAPI.py", line 412, in policies
    result.add(self.policy(reference=ref))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pyPreservica\retentionAPI.py", line 99, in policy
    f'.//{{{self.rm_ns}}}RetentionPolicy/{{{self.rm_ns}}}ExpiryAction').text
                                                                        ^^^^
AttributeError: 'NoneType' object has no attribute 'text'

This also appeared when creating a new policy.

carj commented 1 year ago

I have published a new version

https://pypi.org/project/pyPreservica/1.7.0/

Can you upgrade to the new version and try again.

pip install pyPreservica --upgrade