muccg / rdrf

The Rare Disease Registry Framework (RDRF) is an open source tool for the creation of web-based patient registries.
GNU Affero General Public License v3.0
15 stars 8 forks source link

CIC LC: Patient report errors #1255

Closed gmaloneccg closed 4 years ago

gmaloneccg commented 4 years ago

On CIC LC staging, version 6.1.8, on the patient's demographics page, logged in as curator.

Opening the drop-down menu for patient 110 shows two options for the patient report. The first option links to ciclung/customactions/1/0, the second option links to ciclung/customactions/1/110 (assumed to be referring to the patient number). Selecting either option results in an AttributeError.

Identical behaviour also occurs for patient 8, implying that it occurs for all patients.

Traceback for "patient zero" option provided below:

Environment:

Request Method: GET
Request URL: https://rdrf.ccgapps.com.au/ciclung/customactions/1/0

Django Version: 2.1.15
Python Version: 3.7.6
Installed Applications:
['django.contrib.contenttypes',
 'django.contrib.auth',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'django.contrib.messages',
 'django_extensions',
 'django.contrib.admin',
 'messages_ui',
 'ajax_select',
 'explorer',
 'useraudit',
 'templatetag_handlebars',
 'iprestrict',
 'rest_framework',
 'anymail',
 'rdrf',
 'registry.groups',
 'registry.patients',
 'registry.common',
 'registry.genetic',
 'registration',
 'reversion',
 'storages',
 'django_otp',
 'django_otp.plugins.otp_static',
 'django_otp.plugins.otp_totp',
 'two_factor',
 'django_user_agents',
 'formtools',
 'session_security']
Installed Middleware:
('useraudit.middleware.RequestToThreadLocalMiddleware',
 'django.middleware.common.CommonMiddleware',
 'iprestrict.middleware.IPRestrictMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django_otp.middleware.OTPMiddleware',
 'registry.common.middleware.EnforceTwoFactorAuthMiddleware',
 'session_security.middleware.SessionSecurityMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'django_user_agents.middleware.UserAgentMiddleware')

Traceback:

File "/env/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/env/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  126.                 response = self.process_exception_by_middleware(e, request)

File "/env/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  124.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/env/lib/python3.7/site-packages/django/views/generic/base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "/env/lib/python3.7/site-packages/django/views/generic/base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "/env/lib/python3.7/site-packages/rdrf/views/custom_actions.py" in get
  17.             return custom_action.execute(user)

File "/env/lib/python3.7/site-packages/rdrf/models/definition/models.py" in execute
  1910.             result = patient_report.execute(self.registry, self.name, self.data, user, patient_model)

File "/env/lib/python3.7/site-packages/rdrf/services/io/actions/patient_report.py" in execute
  221.     parser = ReportParser(registry_model, report_name, report_spec, user, patient_model)

File "/env/lib/python3.7/site-packages/rdrf/services/io/actions/patient_report.py" in __init__
  156.         self.clinical_data = self._load()

File "/env/lib/python3.7/site-packages/rdrf/services/io/actions/patient_report.py" in _load
  168.             for context_model in self.patient_model.context_models:

Exception Type: AttributeError at /customactions/1/0
Exception Value: 'NoneType' object has no attribute 'context_models'
gmaloneccg commented 4 years ago

The option for the "patient zero" report (/ciclung/customactions/1/0) appears in the menu on the consents and PROMS requests page. The patient report option does not appear for the current patient (there is only one option in the menu).

gmaloneccg commented 4 years ago

These behaviours occur for both clinical staff and admin; tested admin just now.