Style fixes and add ValueError exception catching to soc.views.helper.request module