Uploaded image for project: 'Hue'
  1. Hue
  2. HUE-6654

[doc2] Do not fail import when document parent directory is null

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.12.0
    • Fix Version/s: 4.0.0
    • Component/s: core.backend
    • Labels:
      None

      Description

      When parent_directory of a document in JSON is null

      import document fails with the following error

      Traceback:
      File "/opt/cloudera/parcels/CDH-5.10.1-1.cdh5.10.1.p0.10/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/handlers/base.py" in get_response
      112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
      File "/opt/cloudera/parcels/CDH-5.10.1-1.cdh5.10.1.p0.10/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/db/transaction.py" in inner
      371. return func(*args, **kwargs)
      File "/opt/cloudera/parcels/CDH-5.10.1-1.cdh5.10.1.p0.10/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/utils/decorators.py" in _wrapped_view
      99. response = view_func(request, *args, **kwargs)
      File "/opt/cloudera/parcels/CDH-5.10.1-1.cdh5.10.1.p0.10/lib/hue/desktop/core/src/desktop/api2.py" in import_documents
      470. doc = _copy_document_with_owner(doc, request.user, uuids_map)
      File "/opt/cloudera/parcels/CDH-5.10.1-1.cdh5.10.1.p0.10/lib/hue/desktop/core/src/desktop/api2.py" in _copy_document_with_owner
      627. parent_uuid = doc['fields']['parent_directory'][0]

      Exception Type: TypeError at /desktop/api2/doc/import
      Exception Value: 'NoneType' object is unsubscriptable
      Request information:
      GET: No GET data

        Attachments

          Activity

            People

            • Assignee:
              krish Sai K Chirravuri
              Reporter:
              krish Sai K Chirravuri
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: