muccg / angelman

RDRF based software for the Global Angelman Registry
GNU Affero General Public License v3.0
1 stars 0 forks source link

Changing patient's preferred clinician to Test Clinician results in Attribute Error #322

Open gmaloneccg opened 5 years ago

gmaloneccg commented 5 years ago

Request Method: | POST
-- | --
https://rdrf.ccgapps.com.au/angelman/ang/71/clinician
2.1.7
AttributeError
'NoneType' object has no attribute 'code'
/env/src/django-rdrf/rdrf/registry/patients/models.py in selected_clinician_notification, line 1198
/env/bin/uwsgi
3.7.4
['.',  '/app',  '/usr/local/lib/python37.zip',  '/usr/local/lib/python3.7',  '/usr/local/lib/python3.7/lib-dynload',  '/env/lib/python3.7/site-packages',  '/env/src/django-rdrf/rdrf',  '/app/angelman']
Mon, 22 Jul 2019 10:22:36 +0800
gmaloneccg commented 5 years ago

As parent (test_parent@email.com), navigate to Home Page, select "Clinician" form. Select "Test Clinician (Test Clinician Working Group)" as the preferred clinician, and save.

gmaloneccg commented 5 years ago
Environment:

Request Method: POST
Request URL: https://rdrf.ccgapps.com.au/angelman/ang/71/clinician

Django Version: 2.1.7
Python Version: 3.7.4
Installed Applications:
['angelman',
 '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']
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',
 '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 "/usr/local/lib/python3.7/contextlib.py" in inner
  74.                 return func(*args, **kwds)

File "/env/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "/env/lib/python3.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  21.                 return view_func(request, *args, **kwargs)

File "/env/src/django-rdrf/rdrf/rdrf/views/clinician_view.py" in post
  246.                 other_clinician_model.patient.save()

File "/env/src/django-rdrf/rdrf/registry/patients/models.py" in save
  816.         super(Patient, self).save(*args, **kwargs)

File "/env/lib/python3.7/site-packages/django/db/models/base.py" in save
  718.                        force_update=force_update, update_fields=update_fields)

File "/env/lib/python3.7/site-packages/django/db/models/base.py" in save_base
  758.                 update_fields=update_fields, raw=raw, using=using,

File "/env/lib/python3.7/site-packages/django/dispatch/dispatcher.py" in send
  175.             for receiver in self._live_receivers(sender)

File "/env/lib/python3.7/site-packages/django/dispatch/dispatcher.py" in <listcomp>
  175.             for receiver in self._live_receivers(sender)

File "/env/src/django-rdrf/rdrf/registry/patients/models.py" in selected_clinician_notification
  1198.         process_notification(registry_model.code,

Exception Type: AttributeError at /ang/71/clinician
Exception Value: 'NoneType' object has no attribute 'code'