Added a public redirect
Also some minor cleanups in the redirects code.
Patch by: Sverre Rabbelier
--- a/app/soc/views/helper/redirects.py Sun Dec 07 13:49:22 2008 +0000
+++ b/app/soc/views/helper/redirects.py Sun Dec 07 15:01:31 2008 +0000
@@ -22,22 +22,12 @@
]
-def getCreateRequestRedirect(entity, params):
- """Returns the create request redirect for the specified entity.
- """
-
- result ='/request/create/%s/%s/%s' % (
- params['group_scope'], params['url_name'], entity.key().name())
-
- return result
-
-
def getInviteRedirect(entity, params):
"""Returns the invitation redirect for the specified entity.
"""
result ='/%s/invite/%s' % (
- params['url_name'], entity.key().name())
+ params['url_name'], entity.key().name())
return result
@@ -47,7 +37,7 @@
"""
result ='/%s/create/%s' % (
- params['url_name'], entity.key().name())
+ params['url_name'], entity.key().name())
return result
@@ -56,8 +46,26 @@
"""Returns the edit redirect for the specified entity.
"""
- url_name = params['url_name']
- return '/%s/edit/%s' % (url_name, entity.key().name())
+ return '/%s/edit/%s' % (
+ params['url_name'], entity.key().name())
+
+
+def getPublicRedirect(entity, params):
+ """Returns the public redirect for the specified entity.
+ """
+
+ return '/%s/show/%s' % (
+ params['url_name'], entity.key().name())
+
+
+def getCreateRequestRedirect(entity, params):
+ """Returns the create request redirect for the specified entity.
+ """
+
+ result ='/request/create/%s/%s/%s' % (
+ params['group_scope'], params['url_name'], entity.key().name())
+
+ return result
def inviteAcceptedRedirect(entity, _):