Testing fix for 500 internal server error/TypeError: argument of type 'NoneType' is not iterable