now getting form errors instead of IntegrityError
fix various issues pointed out by PyCharm inspections