GovReady / govready-q

An open source, self-service GRC tool to automate security assessments and compliance.
https://q.govready.com
Other
179 stars 55 forks source link

Catching errors when flattening controls. #1724

Closed Tom-Camp closed 2 years ago

Tom-Camp commented 2 years ago

When going to a Controls page, for example /systems/38/controls/selected, using the ARS Catalog, I get the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/usr/src/app/controls/views.py", line 163, in controls_selected
    controls.sort(key=lambda control: control.get_flattened_oscal_control_as_dict()['sort_id'])

Exception Type: TypeError at /systems/38/controls/selected
Exception Value: '<' not supported between instances of 'NoneType' and 'str' 

This doesn't fix the issue, but allows the page to load as expected.

gregelin commented 2 years ago

@Tom-Camp Do you want this PR merged, or did you mention that you have a fix for the ARS issue?

gregelin commented 2 years ago

@Tom-Camp requesting same changes here as in #1723.

gregelin commented 2 years ago

Closed as overtaken by events.