Commit eaa427f8 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_officejs_support_request_ui: fix test failure

- Allow superuser to get RSS ;
- Remove useless portal_skin=RSS paremeter.
parent f10247c6
...@@ -2,17 +2,15 @@ from zExceptions import Unauthorized ...@@ -2,17 +2,15 @@ from zExceptions import Unauthorized
import json import json
absolute_url = context.absolute_url() absolute_url = context.absolute_url()
href = "SupportRequestModule_viewLastSupportRequestListAsRss" request_url = "%s/SupportRequestModule_viewLastSupportRequestListAsRss" % (absolute_url,)
portal = context.getPortalObject() portal = context.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue() person = portal.portal_membership.getAuthenticatedMember().getUserValue()
if person is None: if person is None:
raise Unauthorized("You must logged in first!") return json.dumps({'restricted_access_url': request_url})
access_token = None access_token = None
request_url = "%s/%s" % (absolute_url, href)
for token_item in portal.portal_catalog( for token_item in portal.portal_catalog(
portal_type="Restricted Access Token", portal_type="Restricted Access Token",
default_agent_uid=person.getUid(), default_agent_uid=person.getUid(),
...@@ -33,9 +31,8 @@ if access_token is None: ...@@ -33,9 +31,8 @@ if access_token is None:
reference = access_token.getReference() reference = access_token.getReference()
access_token.validate() access_token.validate()
url = "%s/%s?portal_skin=RSS&access_token=%s&access_token_secret=%s" % ( url = "%s?access_token=%s&access_token_secret=%s" % (
absolute_url, request_url,
href,
access_token.getId(), access_token.getId(),
reference) reference)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment