Skip to content

Update indigo_api/models/documents.py #5951

Update indigo_api/models/documents.py

Update indigo_api/models/documents.py #5951

GitHub Actions / Test Results failed Jan 16, 2025 in 0s

1 errors, 568 pass in 4m 11s

569 tests   568 ✅  4m 11s ⏱️
 60 suites    0 💤
 60 files      0 ❌  1 🔥

Results for commit 6717916.

Annotations

Check failure on line 72 in indigo_api/tests/test_analysis_api.py

See this annotation in the file changed.

@github-actions github-actions / Test Results

test_link_terms_portion (indigo_api.tests.test_analysis_api.AnalysisTestCase) with error

test-reports/TEST-indigo_api.tests.test_analysis_api.AnalysisTestCase-20250116101126.xml [took 1s]
Raw output
'NoneType' object has no attribute 'getparent'
Traceback (most recent call last):
  File "/home/runner/work/indigo/indigo/indigo_api/tests/test_analysis_api.py", line 73, in test_link_terms_portion
    response = self.client.post('/api/documents/1/analysis/link-terms', {
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/test.py", line 295, in post
    response = super().post(
               ^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/test.py", line 209, in post
    return self.generic('POST', path, data, content_type, **extra)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/test.py", line 233, in generic
    return super().generic(
           ^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/django/test/client.py", line 609, in generic
    return self.request(**r)
           ^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/test.py", line 285, in request
    return super().request(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/test.py", line 237, in request
    request = super().request(**kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/django/test/client.py", line 891, in request
    self.check_exception(response)
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/django/test/client.py", line 738, in check_exception
    raise exc_value
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/indigo/indigo/indigo_api/views/documents.py", line 374, in post
    serializer.update_document()
  File "/home/runner/work/indigo/indigo/indigo_api/serializers.py", line 464, in update_document
    self.set_content()
  File "/home/runner/work/indigo/indigo/indigo_api/serializers.py", line 477, in set_content
    document.update_provision_xml(provision_eid, xml)
  File "/home/runner/work/indigo/indigo/indigo_api/models/documents.py", line 565, in update_provision_xml
    old_provision.getparent().replace(old_provision, updated_provision)
    ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'getparent'