Role overview membership is now determined by setting show_in_roles_overview param to true in the view.
Also added student roles to the list.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/views/models/club_admin.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/models/club_admin.py Tue Feb 17 20:34:01 2009 +0000
@@ -75,6 +75,7 @@
new_params['extra_dynaexclude'] = ['agreed_to_tos']
new_params['allow_invites'] = True
+ new_params['show_in_roles_overview'] = False
params = dicts.merge(params, new_params)
--- a/app/soc/views/models/club_member.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/models/club_member.py Tue Feb 17 20:34:01 2009 +0000
@@ -77,6 +77,7 @@
new_params['extra_dynaexclude'] = ['agreed_to_tos']
new_params['allow_requests_and_invites'] = True
+ new_params['show_in_roles_overview'] = False
params = dicts.merge(params, new_params)
--- a/app/soc/views/models/host.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/models/host.py Tue Feb 17 20:34:01 2009 +0000
@@ -89,6 +89,7 @@
'clean_photo_url': cleaning.clean_url('photo_url')}
new_params['allow_invites'] = True
+ new_params['show_in_roles_overview'] = True
params = dicts.merge(params, new_params)
--- a/app/soc/views/models/mentor.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/models/mentor.py Tue Feb 17 20:34:01 2009 +0000
@@ -90,6 +90,7 @@
}
new_params['allow_requests_and_invites'] = True
+ new_params['show_in_roles_overview'] = True
params = dicts.merge(params, new_params)
--- a/app/soc/views/models/org_admin.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/models/org_admin.py Tue Feb 17 20:34:01 2009 +0000
@@ -95,6 +95,7 @@
}
new_params['allow_invites'] = True
+ new_params['show_in_roles_overview'] = True
params = dicts.merge(params, new_params)
--- a/app/soc/views/models/role.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/models/role.py Tue Feb 17 20:34:01 2009 +0000
@@ -155,6 +155,10 @@
# add manage template
params['manage_template'] = 'soc/%(module_name)s/manage.html' % params
+ if params.get('show_in_roles_overview'):
+ # add to roles overview
+ addRole(self)
+
@decorators.merge_params
@decorators.check_access
def invite(self, request, access_type,
--- a/app/soc/views/models/student.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/models/student.py Tue Feb 17 20:34:01 2009 +0000
@@ -99,6 +99,8 @@
label=ugettext('I agree to the Student Agreement')),
}
+ new_params['show_in_roles_overview'] = True
+
params = dicts.merge(params, new_params)
super(View, self).__init__(params=params)
@@ -116,6 +118,8 @@
self._params['user_create_form'] = user_create_form
+ role.addRole(self)
+
@decorators.merge_params
@decorators.check_access
def apply(self, request, access_type,
--- a/app/soc/views/models/user_self.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/models/user_self.py Tue Feb 17 20:34:01 2009 +0000
@@ -235,7 +235,6 @@
user = user_logic.getForCurrentAccount()
-
# only select the roles for the current user
filter = {
'link_id': user.link_id,
--- a/app/soc/views/sitemap/build.py Tue Feb 17 20:15:43 2009 +0000
+++ b/app/soc/views/sitemap/build.py Tue Feb 17 20:34:01 2009 +0000
@@ -95,12 +95,6 @@
sitemap.addPages(user_self.view.getDjangoURLPatterns())
sitemap.addPages(user.view.getDjangoURLPatterns())
-#role.addRole(club_admin.view)
-#role.addRole(club_member.view)
-role.addRole(host.view)
-role.addRole(org_admin.view)
-role.addRole(mentor.view)
-
def getPatterns():
return defaults.patterns(None, *sitemap.SITEMAP)