OpenOversight
OpenOversight copied to clipboard
New Officer Form throws a bug when a description or note is added
Desired Outcome:
- When an admin or AC creates an officer, if they include a description, the app successfully creates the officer
- When an admin or AC creates an officer, if they include a description, the app successfully creates the officer
Current Outcome:
- When an admin or AC creates an officer and includes a description, the app throws the below bug:
TypeError: 'description' is an invalid keyword argument for Description
File "/usr/src/app/OpenOversight/app/main/views.py", line 689, in add_officer
officer = add_officer_profile(form, current_user)
File "/usr/src/app/OpenOversight/app/utils.py", line 181, in add_officer_profile
date_updated=datetime.datetime.now())
- When an admin or AC creates an officer and includes a note, the app throws the below bug:
TypeError: 'note' is an invalid keyword argument for Note
File "/usr/src/app/OpenOversight/app/main/views.py", line 689, in add_officer
officer = add_officer_profile(form, current_user)
File "/usr/src/app/OpenOversight/app/utils.py", line 170, in add_officer_profile
date_updated=datetime.datetime.now())
Steps to Reproduce:
- Log in as an admin or AC
- Create an officer. Include a note or description in the new officer form. (If you are logged in as an AC, you will only be able to create officers for your department.)
- Behold the error message.
Relevant areas of the codebase:
- the method
add_officer_profile
inmain/views.py
- the method
add_officer
inutils.py