Do not crash on *every* page load if there is no ToS Document.
authorTodd Larsen <tlarsen@google.com>
Tue, 20 Jan 2009 22:33:43 +0000
changeset 855 fbc1a87364ac
parent 854 bb43b74c58f6
child 856 3d14b31e72e4
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
app/soc/views/helper/responses.py
--- 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'})