adding subject while screening number is unable throws Internet server error
Adding new subject occurs is below error if in Configuration>study>Available subject study data
Screening number
is unticked.
ERROR 2022-03-02 11:04:36,357 view_utils 3577704 140326665668416 When handling POST request for url '/study/1/subjects/add' exception occurred
Traceback (most recent call last):
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/core/handlers/base.py", line 179, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/smasch/web/decorators.py", line 109, in func_wrapper
return func(thing, *args, **kwargs)
File "/usr/lib/smasch/web/views/subject.py", line 45, in subject_add
if study_subject_form.is_valid() and subject_form.is_valid():
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/forms/forms.py", line 177, in is_valid
return self.is_bound and not self.errors
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/forms/forms.py", line 172, in errors
self.full_clean()
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/forms/forms.py", line 375, in full_clean
self._clean_form()
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/forms/forms.py", line 402, in _clean_form
cleaned_data = self.clean()
File "/usr/lib/smasch/web/forms/study_subject_forms.py", line 181, in clean
validate_subject_screening_number(self, cleaned_data)
File "/usr/lib/smasch/web/forms/study_subject_forms.py", line 351, in validate_subject_screening_number
subjects_from_db = StudySubject.objects.filter(screening_number=cleaned_data["screening_number"],
KeyError: 'screening_number'
ERROR 2022-03-02 11:04:36,359 log 3577704 140326665668416 Internal Server Error: /study/1/subjects/add
Traceback (most recent call last):
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/core/handlers/base.py", line 179, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/smasch/web/decorators.py", line 109, in func_wrapper
return func(thing, *args, **kwargs)
File "/usr/lib/smasch/web/views/subject.py", line 45, in subject_add
if study_subject_form.is_valid() and subject_form.is_valid():
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/forms/forms.py", line 177, in is_valid
return self.is_bound and not self.errors
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/forms/forms.py", line 172, in errors
self.full_clean()
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/forms/forms.py", line 375, in full_clean
self._clean_form()
File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/forms/forms.py", line 402, in _clean_form
cleaned_data = self.clean()
File "/usr/lib/smasch/web/forms/study_subject_forms.py", line 181, in clean
validate_subject_screening_number(self, cleaned_data)
File "/usr/lib/smasch/web/forms/study_subject_forms.py", line 351, in validate_subject_screening_number
subjects_from_db = StudySubject.objects.filter(screening_number=cleaned_data["screening_number"],
KeyError: 'screening_number'