Fixed requests not working anymore
We really need a test suite.
Patch by: Sverre Rabbelier
--- a/app/soc/views/helper/params.py Sat Nov 29 21:04:09 2008 +0000
+++ b/app/soc/views/helper/params.py Sat Nov 29 21:21:04 2008 +0000
@@ -93,8 +93,8 @@
new_params['sidebar_additional'] = []
new_params['key_fields_prefix'] = []
- new_params['link_id_arg_pattern'] = linkable.LINK_ID_PATTERN_CORE
- new_params['link_id_pattern_core'] = linkable.LINK_ID_ARG_PATTERN
+ new_params['link_id_arg_pattern'] = linkable.LINK_ID_ARG_PATTERN
+ new_params['link_id_pattern_core'] = linkable.LINK_ID_PATTERN_CORE
new_params['django_patterns'] = None
new_params['django_patterns_defaults'] = [
--- a/app/soc/views/models/host.py Sat Nov 29 21:04:09 2008 +0000
+++ b/app/soc/views/models/host.py Sat Nov 29 21:21:04 2008 +0000
@@ -105,7 +105,7 @@
params = dicts.merge(original_params, params)
- role.RoleView.__init__(self, original_params=params)
+ role.RoleView.__init__(self, params=params)
def _editSeed(self, request, seed):
"""See base.View._editGet().
--- a/app/soc/views/models/role.py Sat Nov 29 21:04:09 2008 +0000
+++ b/app/soc/views/models/role.py Sat Nov 29 21:21:04 2008 +0000
@@ -34,6 +34,7 @@
from soc.logic.models import user as user_logic
from soc.views import helper
from soc.views import out_of_band
+from soc.views.helper import access
from soc.views.models import base
from soc.views.models import user as user_view
@@ -73,16 +74,13 @@
DEF_INVITE_INSTRUCTION_MSG_FMT = ugettext_lazy(
'Please use this form to invite someone to become a %(name)s.')
- def __init__(self, original_params=None):
+ def __init__(self, params=None):
"""
Args:
original_params: This dictionary should be filled with the parameters
"""
- params = {}
- params = dicts.merge(original_params, params)
-
base.View.__init__(self, params=params)
def invite(self, request, page_name=None, params=None, **kwargs):
@@ -102,7 +100,7 @@
params = dicts.merge(new_params, user_view.view._params)
try:
- self.checkAccess('invite', request)
+ access.checkAccess('invite', request, rights=params['rights'])
except out_of_band.Error, error:
return error.response(request)
@@ -123,13 +121,15 @@
"""See base.View.getDjangoURLPatterns().
"""
- params = {}
default_patterns = self._params['django_patterns_defaults']
default_patterns += [
(r'^%(url_name)s/invite/%(lnp)s$',
'soc.views.models.%s.invite', 'Invite %(name_short)s')]
+ params = {}
params['django_patterns_defaults'] = default_patterns
+
+ params = dicts.merge(params, self._params)
patterns = super(RoleView, self).getDjangoURLPatterns(params)
return patterns