Do not crash on *every* page load if there is no ToS Document.
'tos' ReferenceProperty might be present, but still be None.
Patch by: Todd Larsen
Review by: to-be-reviewed
--- a/app/soc/views/helper/responses.py Tue Jan 20 22:30:21 2009 +0000
+++ b/app/soc/views/helper/responses.py Tue Jan 20 22:33:43 2009 +0000
@@ -187,5 +187,8 @@
except db.Error:
return None
+ if not tos_doc:
+ return None
+
return redirects.getPublicRedirect(tos_doc, {'url_name': 'document'})