Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
3db880ef
Commit
3db880ef
authored
Sep 26, 2011
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Site_getKnowledgePadListForUser should handle Unauthorized exception.
parent
301fae53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml
...rp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml
+15
-3
bt5/erp5_knowledge_pad/bt/change_log
bt5/erp5_knowledge_pad/bt/change_log
+3
-0
bt5/erp5_knowledge_pad/bt/revision
bt5/erp5_knowledge_pad/bt/revision
+1
-1
No files found.
bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_getKnowledgePadListForUser.xml
View file @
3db880ef
...
...
@@ -53,6 +53,18 @@
<value>
<string>
request = context.REQUEST\n
isAnon = context.portal_membership.isAnonymousUser()\n
isAnonymousKnowledgePadUsed = request.get(\'is_anonymous_knowledge_pad_used\', 0);\n
from zExceptions import Unauthorized\n
\n
def safe_filter(func, list):\n
ret = []\n
append = ret.append\n
for e in list:\n
try:\n
if func(e):\n
append(e)\n
except Unauthorized:\n
pass\n
return ret\n
\n
def filterKnowledgePadListForContext(results, mode, \n
default_pad_group):\n
...
...
@@ -66,15 +78,15 @@ def filterKnowledgePadListForContext(results, mode, \n
if mode == \'erp5_front\':\n
# leave only those not having a publication_section as \n
# this means belonging to root\n
results = filter(lambda x: x.getPublicationSection() is None and \\\n
results =
safe_
filter(lambda x: x.getPublicationSection() is None and \\\n
x.getGroup() is None, results)\n
elif mode == \'web_front\':\n
# Web Site must at least one Pad referenced by context\n
results = filter(lambda x: x.getPublicationSectionValue() == real_context and \\\n
results =
safe_
filter(lambda x: x.getPublicationSectionValue() == real_context and \\\n
x.getGroup() is None, results)\n
elif mode == \'web_section\':\n
# Web Sections, Web Pages can "reuse" tabs\n
results = filter(lambda x: x.getPublicationSectionValue() == real_context or \\\n
results =
safe_
filter(lambda x: x.getPublicationSectionValue() == real_context or \\\n
x.getGroup() == default_pad_group, results)\n
return results\n
\n
...
...
bt5/erp5_knowledge_pad/bt/change_log
View file @
3db880ef
2011-09-26 Kazuhiko
* ERP5Site_getKnowledgePadListForUser should handle Unauthorized exception.
2011-07-01 yusei
* Set proper title to interaction workflow.
...
...
bt5/erp5_knowledge_pad/bt/revision
View file @
3db880ef
724
\ No newline at end of file
725
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment