Redirect to show if there is no home document
authorSverre Rabbelier <srabbelier@gmail.com>
Sun, 22 Mar 2009 22:54:40 +0000
changeset 1992 6a476fb946c9
parent 1991 3aeda3007467
child 1993 00997a7675f2
Redirect to show if there is no home document Patch by: Sverre Rabbelier
app/soc/views/models/presence.py
--- a/app/soc/views/models/presence.py	Sun Mar 22 22:54:14 2009 +0000
+++ b/app/soc/views/models/presence.py	Sun Mar 22 22:54:40 2009 +0000
@@ -103,8 +103,12 @@
     Overrides public_template to point at 'home_template'.
     """
 
+    key_name = self._logic.getKeyNameFromFields(kwargs)
+    redirect = '/%s/show/%s' % (self._params['url_name'], key_name)
+
     new_params = {}
     new_params['public_template'] = self._params['home_template']
+    new_params['public_redirect'] = redirect
 
     params = dicts.merge(params, new_params)