Closed marshalc closed 7 years ago
Admin report generating an ISE 500 with:
Internal Server Error: /en-gb/wp4/administration/dmc/death-summaries FieldError at /en-gb/wp4/administration/dmc/death-summaries Cannot resolve keyword 'date_of_death' into field. Choices are: _order, action, admitted_to_itu, alive_query_1, alive_query_2, alive_query_3, alive_query_4, alive_query_5, alive_query_6, alive_query_7, alive_query_8, alive_query_9, biopsy_taken, categories, cause_of_death_1, cause_of_death_2, cause_of_death_3, cause_of_death_4, cause_of_death_5, cause_of_death_6, cause_of_death_comment, contact, contact_id, date_of_admission, date_of_discharge, death, description, dialysis_needed, event_ongoing, id, live, onset_at_date, organ, organ_id, outcome, record_locked, rehospitalisation, rehospitalisation_comments, serious_eligible_1, serious_eligible_2, serious_eligible_3, serious_eligible_4, serious_eligible_5, serious_eligible_6, surgery_required, treatment_related Request Method: GET Request URL: https://cope.nds.ox.ac.uk/en-gb/wp4/administration/dmc/death-summaries Django Version: 1.10.6 Python Executable: /sites/.virtualenvs/py3_cope/bin/python3 Python Version: 3.5.2 Python Path: ['/sites/py3_cope/cope_repo', '/sites/.virtualenvs/py3_cope/bin', '/sites/py3_cope/cope_repo/${PYTHONPATH}', '/sites/py3_cope/cope_repo', '/sites/.virtualenvs/py3_cope/lib/python35.zip', '/sites/.virtualenvs/py3_cope/lib/python3.5', '/sites/.virtualenvs/py3_cope/lib/python3.5/plat-x86_64-linux-gnu', '/sites/.virtualenvs/py3_cope/lib/python3.5/lib-dynload', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages', '/sites/.virtualenvs/py3_cope/src/django-crispy-forms'] Server time: Tue, 21 Mar 2017 02:09:53 +0000 Installed Applications: ['dal', 'dal_select2', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'django.contrib.admin', 'django.contrib.admindocs', 'crispy_forms', 'reversion', 'reversion_compare', 'wp4.compare', 'wp4.locations', 'wp4.staff', 'wp4.perfusion_machine', 'wp4.health_economics', 'wp4.samples', 'wp4.adverse_event', 'wp4.followups', 'wp4.administration', 'wp4.theme', 'djangosecure', 'gunicorn'] Installed Middleware: ['djangosecure.middleware.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'reversion.middleware.RevisionMiddleware', 'config.middleware.activate_timezone.TimezoneMiddleware'] Traceback: File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner 42. response = get_response(request) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/base.py" in _legacy_get_response 249. response = self._get_response(request) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 23. return view_func(request, *args, **kwargs) File "/sites/py3_cope/cope_repo/wp4/administration/views.py" in dmc_death_summaries 847. listing = Event.objects.filter(date_of_death__isnull=False).select_related('organ__recipient').\ File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method 85. return getattr(self.get_queryset(), name)(*args, **kwargs) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/db/models/query.py" in filter 796. return self._filter_or_exclude(False, *args, **kwargs) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/db/models/query.py" in _filter_or_exclude 814. clone.query.add_q(Q(*args, **kwargs)) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/db/models/sql/query.py" in add_q 1227. clause, _ = self._add_q(q_object, self.used_aliases) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/db/models/sql/query.py" in _add_q 1253. allow_joins=allow_joins, split_subq=split_subq, File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/db/models/sql/query.py" in build_filter 1133. lookups, parts, reffed_expression = self.solve_lookup_type(arg) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/db/models/sql/query.py" in solve_lookup_type 1019. _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta()) File "/sites/.virtualenvs/py3_cope/lib/python3.5/site-packages/django/db/models/sql/query.py" in names_to_path 1327. "Choices are: %s" % (name, ", ".join(available))) Exception Type: FieldError at /en-gb/wp4/administration/dmc/death-summaries Exception Value: Cannot resolve keyword 'date_of_death' into field. Choices are: _order, action, admitted_to_itu, alive_query_1, alive_query_2, alive_query_3, alive_query_4, alive_query_5, alive_query_6, alive_query_7, alive_query_8, alive_query_9, biopsy_taken, categories, cause_of_death_1, cause_of_death_2, cause_of_death_3, cause_of_death_4, cause_of_death_5, cause_of_death_6, cause_of_death_comment, contact, contact_id, date_of_admission, date_of_discharge, death, description, dialysis_needed, event_ongoing, id, live, onset_at_date, organ, organ_id, outcome, record_locked, rehospitalisation, rehospitalisation_comments, serious_eligible_1, serious_eligible_2, serious_eligible_3, serious_eligible_4, serious_eligible_5, serious_eligible_6, surgery_required, treatment_related Request information: USER: Carl Marshall GET: No GET data POST: No POST data FILES: No FILES data COOKIES: university-parks_cookiecontrol = 'yes' _ga = 'GA1.3.1916771954.1470758962' sessionid = 'e4ua8pzahwqob81y31y9eqbutpb1dzv4' ccShowCookieIcon = 'no' __utma = '5873900.1971230262.1454928401.1454928401.1454928401.1' dontShowCookieNotice = 'TRUE' csrftoken = '7J30glGbKboKZiAePKH4RuMHnz5GNiGkkn8sKlh1vszJcXRWiXioXfghKrPLRJyx' META: CSRF_COOKIE = '7J30glGbKboKZiAePKH4RuMHnz5GNiGkkn8sKlh1vszJcXRWiXioXfghKrPLRJyx' HTTP_ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' HTTP_ACCEPT_ENCODING = 'gzip, deflate' HTTP_ACCEPT_LANGUAGE = 'en-gb' HTTP_CONNECTION = 'close' HTTP_COOKIE = 'csrftoken=7J30glGbKboKZiAePKH4RuMHnz5GNiGkkn8sKlh1vszJcXRWiXioXfghKrPLRJyx; sessionid=e4ua8pzahwqob81y31y9eqbutpb1dzv4; __utma=5873900.1971230262.1454928401.1454928401.1454928401.1; ccShowCookieIcon=no; university-parks_cookiecontrol=yes; _ga=GA1.3.1916771954.1470758962; dontShowCookieNotice=TRUE' HTTP_HOST = 'cope.nds.ox.ac.uk' HTTP_REFERER = 'https://cope.nds.ox.ac.uk/en-gb/wp4/administration/' HTTP_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8' HTTP_X_FORWARDED_FOR = '129.67.117.110' HTTP_X_FORWARDED_PROTOCOL = 'https' HTTP_X_REAL_IP = '129.67.117.110' HTTP_X_SCHEME = 'https' PATH_INFO = '/en-gb/wp4/administration/dmc/death-summaries' QUERY_STRING = '' RAW_URI = '/en-gb/wp4/administration/dmc/death-summaries' REMOTE_ADDR = "b''" REQUEST_METHOD = 'GET' SCRIPT_NAME = '' SERVER_NAME = 'cope.nds.ox.ac.uk' SERVER_PORT = '80' SERVER_PROTOCOL = 'HTTP/1.0' SERVER_SOFTWARE = 'gunicorn/19.7.0' gunicorn.socket = <socket.socket fd=12, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, laddr=/sites/py3_cope/var/run/wsgi.socket> wsgi.errors = <gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f0eb4fe97b8> wsgi.file_wrapper = '' wsgi.input = <gunicorn.http.body.Body object at 0x7f0eb4d75390> wsgi.multiprocess = True wsgi.multithread = False wsgi.run_once = False wsgi.url_scheme = 'http' wsgi.version = Settings: Using settings module config.settings.production ABSOLUTE_URL_OVERRIDES = {} ACCOUNT_AUTHENTICATION_METHOD = 'username' ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_EMAIL_VERIFICATION = 'mandatory' ADD_REVERSION_ADMIN = True ADMINS = [('Carl Marshall', 'carl.marshall@nds.ox.ac.uk')] ALLOWED_HOSTS = ['cope.nds.ox.ac.uk', 'localhost', '127.0.0.1'] APPEND_SLASH = True APPS_DIR = <Path:/sites/py3_cope/cope_repo/wp4> AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend'] AUTH_PASSWORD_VALIDATORS = '********************' AUTH_USER_MODEL = 'staff.Person' AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify' BASE_DIR = '/sites/py3_cope/cope_repo' CACHES = {'default': {'LOCATION': '', 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}} CACHE_MIDDLEWARE_ALIAS = 'default' CACHE_MIDDLEWARE_KEY_PREFIX = '********************' CACHE_MIDDLEWARE_SECONDS = 600 CRISPY_TEMPLATE_PACK = 'bootstrap3' CSRF_COOKIE_AGE = 31449600 CSRF_COOKIE_DOMAIN = None CSRF_COOKIE_HTTPONLY = False CSRF_COOKIE_NAME = 'csrftoken' CSRF_COOKIE_PATH = '/' CSRF_COOKIE_SECURE = False CSRF_FAILURE_VIEW = 'django.views.csrf.csrf_failure' CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN' CSRF_TRUSTED_ORIGINS = [] DATABASES = {'default': {'OPTIONS': {}, 'PASSWORD': '********************', 'USER': '', 'PORT': '', 'CONN_MAX_AGE': 0, 'NAME': 'db.sqlite3', 'ATOMIC_REQUESTS': False, 'TEST': {'NAME': None, 'COLLATION': None, 'MIRROR': None, 'CHARSET': None}, 'TIME_ZONE': None, 'AUTOCOMMIT': True, 'HOST': '', 'ENGINE': 'django.db.backends.sqlite3'}} DATABASE_ROUTERS = [] DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440 DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000 DATETIME_FORMAT = 'N j, Y, P' DATETIME_INPUT_FORMATS = ['%d-%m-%Y %H:%M', '%Y-%m-%d %H:%M', '%d/%m/%Y %H:%M', '%Y/%m/%d %H:%M'] DATE_FORMAT = 'N j, Y' DATE_INPUT_FORMATS = ['%d-%m-%Y', '%Y-%m-%d', '%d/%m/%Y', '%Y/%m/%d'] DEBUG = False DEBUG_PROPAGATE_EXCEPTIONS = False DECIMAL_SEPARATOR = '.' DEFAULT_CHARSET = 'utf-8' DEFAULT_CONTENT_TYPE = 'text/html' DEFAULT_EXCEPTION_REPORTER_FILTER = 'django.views.debug.SafeExceptionReporterFilter' DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' DEFAULT_FROM_EMAIL = 'Cope DB <noreply@nds.ox.ac.uk>' DEFAULT_INDEX_TABLESPACE = '' DEFAULT_TABLESPACE = '' DISALLOWED_USER_AGENTS = [] DJANGO_APPS = ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'django.contrib.admin', 'django.contrib.admindocs'] EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_FILE_PATH = '/tmp' EMAIL_HOST = 'smtp.ox.ac.uk' EMAIL_HOST_PASSWORD = '********************' EMAIL_HOST_USER = '' EMAIL_PORT = 25 EMAIL_SSL_CERTFILE = None EMAIL_SSL_KEYFILE = '********************' EMAIL_SUBJECT_PREFIX = '[Cope DB] ' EMAIL_TIMEOUT = None EMAIL_USE_SSL = False EMAIL_USE_TLS = False FILE_CHARSET = 'utf-8' FILE_UPLOAD_DIRECTORY_PERMISSIONS = None FILE_UPLOAD_HANDLERS = ['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler'] FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 FILE_UPLOAD_PERMISSIONS = None FILE_UPLOAD_TEMP_DIR = None FIRST_DAY_OF_WEEK = 0 FIXTURE_DIRS = ['/sites/py3_cope/cope_repo/wp4/fixtures', '/sites/py3_cope/cope_repo/config/fixtures'] FORCE_SCRIPT_NAME = None FORMAT_MODULE_PATH = None IGNORABLE_404_URLS = [] INSTALLED_APPS = ['dal', 'dal_select2', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'django.contrib.admin', 'django.contrib.admindocs', 'crispy_forms', 'reversion', 'reversion_compare', 'wp4.compare', 'wp4.locations', 'wp4.staff', 'wp4.perfusion_machine', 'wp4.health_economics', 'wp4.samples', 'wp4.adverse_event', 'wp4.followups', 'wp4.administration', 'wp4.theme', 'djangosecure', 'gunicorn'] INTERNAL_IPS = [] LANGUAGES = [('en-gb', <django.utils.functional.lazy.<locals>.__proxy__ object at 0x7f0eb6d06f60>), ('fr-be', <django.utils.functional.lazy.<locals>.__proxy__ object at 0x7f0eb6d10320>), ('nl-nl', <django.utils.functional.lazy.<locals>.__proxy__ object at 0x7f0eb6d10710>)] LANGUAGES_BIDI = ['he', 'ar', 'fa', 'ur'] LANGUAGE_CODE = 'en-gb' LANGUAGE_COOKIE_AGE = None LANGUAGE_COOKIE_DOMAIN = None LANGUAGE_COOKIE_NAME = 'django_language' LANGUAGE_COOKIE_PATH = '/' LOCALE_PATHS = ['/sites/py3_cope/cope_repo/locale'] LOCAL_APPS = ['wp4.compare', 'wp4.locations', 'wp4.staff', 'wp4.perfusion_machine', 'wp4.health_economics', 'wp4.samples', 'wp4.adverse_event', 'wp4.followups', 'wp4.administration', 'wp4.theme'] LOGGING = {'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}, 'version': 1, 'handlers': {'console': {'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'verbose'}, 'mail_admins': {'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler', 'filters': ['require_debug_false']}}, 'formatters': {'verbose': {'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'}}, 'loggers': {'loggers': {'django.security.DisallowedHost': {'level': 'ERROR', 'handlers': ['console', 'mail_admins'], 'propagate': True}}, 'django.request': {'level': 'ERROR', 'handlers': ['mail_admins'], 'propagate': True}}, 'disable_existing_loggers': False} LOGGING_CONFIG = 'logging.config.dictConfig' LOGIN_REDIRECT_URL = '/' LOGIN_URL = '/accounts/login/' LOGOUT_REDIRECT_URL = '/' MANAGERS = [('Carl Marshall', 'carl.marshall@nds.ox.ac.uk')] MEDIA_ROOT = '/sites/py3_cope/htdocs/media' MEDIA_URL = '/media/' MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage' MESSAGE_TAGS = {40: 'danger'} MIDDLEWARE = None MIDDLEWARE_CLASSES = ['djangosecure.middleware.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'reversion.middleware.RevisionMiddleware', 'config.middleware.activate_timezone.TimezoneMiddleware'] MIGRATION_MODULES = {} MONTH_DAY_FORMAT = 'F j' NUMBER_GROUPING = 0 PASSWORD_HASHERS = '********************' PASSWORD_RESET_TIMEOUT_DAYS = '********************' PREPEND_WWW = False REDIRECT_FIELD_NAME = 'redirect_to' ROOT_DIR = <Path:/sites/py3_cope/cope_repo> ROOT_URLCONF = 'config.urls' SECRET_KEY = '********************' SECURE_BROWSER_XSS_FILTER = True SECURE_CONTENT_TYPE_NOSNIFF = True SECURE_FRAME_DENY = True SECURE_HSTS_INCLUDE_SUBDOMAINS = True SECURE_HSTS_SECONDS = 60 SECURE_PROXY_SSL_HEADER = SECURE_REDIRECT_EXEMPT = [] SECURE_SSL_HOST = None SECURE_SSL_REDIRECT = True SECURITY_MIDDLEWARE = ['djangosecure.middleware.SecurityMiddleware'] SERVER_EMAIL = 'Cope DB <noreply@nds.ox.ac.uk>' SESSION_CACHE_ALIAS = 'default' SESSION_COOKIE_AGE = 1209600 SESSION_COOKIE_DOMAIN = None SESSION_COOKIE_HTTPONLY = True SESSION_COOKIE_NAME = 'sessionid' SESSION_COOKIE_PATH = '/' SESSION_COOKIE_SECURE = False SESSION_ENGINE = 'django.contrib.sessions.backends.db' SESSION_EXPIRE_AT_BROWSER_CLOSE = False SESSION_FILE_PATH = None SESSION_SAVE_EVERY_REQUEST = False SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer' SETTINGS_MODULE = 'config.settings.production' SHORT_DATETIME_FORMAT = 'm/d/Y P' SHORT_DATE_FORMAT = 'm/d/Y' SIGNING_BACKEND = 'django.core.signing.TimestampSigner' SILENCED_SYSTEM_CHECKS = [] SITE_ID = 1 STATICFILES_DIRS = ['/sites/py3_cope/cope_repo/wp4/static', '/sites/py3_cope/cope_repo/docs/static'] STATICFILES_FINDERS = ['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder'] STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' STATIC_ROOT = '/sites/py3_cope/htdocs/' STATIC_URL = '/static/' TEMPLATES = [{'OPTIONS': {'debug': False, 'loaders': [('django.template.loaders.cached.Loader', ['django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader'])], 'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.template.context_processors.i18n', 'django.template.context_processors.tz', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.contrib.messages.context_processors.messages']}, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['/sites/py3_cope/cope_repo/wp4/templates']}] TEST_NON_SERIALIZED_APPS = [] TEST_RUNNER = 'django.test.runner.DiscoverRunner' THIRD_PARTY_APPS = ['crispy_forms', 'reversion', 'reversion_compare'] THIRD_PARTY_PRE_DJANGO_APPS = ['dal', 'dal_select2'] THOUSAND_SEPARATOR = ',' TIME_FORMAT = 'P' TIME_INPUT_FORMATS = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] TIME_ZONE = 'UTC' USE_ETAGS = False USE_I18N = True USE_L10N = True USE_THOUSAND_SEPARATOR = False USE_TZ = True USE_X_FORWARDED_HOST = False USE_X_FORWARDED_PORT = False WSGI_APPLICATION = 'config.wsgi.application' X_FRAME_OPTIONS = 'SAMEORIGIN' YEAR_MONTH_FORMAT = 'F Y'
Fixed
Admin report generating an ISE 500 with: