Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
amrani
erp5
Commits
d14b42d1
Commit
d14b42d1
authored
Nov 25, 2016
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Person_createUserPreference: React on exception.
Rather than testing before calling.
parent
86bcf70b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_createUserPreference.py
...tem/portal_skins/erp5_base/Person_createUserPreference.py
+6
-5
No files found.
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_createUserPreference.py
View file @
d14b42d1
...
@@ -7,13 +7,14 @@ portal = context.getPortalObject()
...
@@ -7,13 +7,14 @@ portal = context.getPortalObject()
if
not
portal
.
Base_checkPermission
(
'portal_preferences'
,
'Add portal content'
):
if
not
portal
.
Base_checkPermission
(
'portal_preferences'
,
'Add portal content'
):
return
return
if
not
context
.
getReference
():
try
:
# noop in case if invoked on non loggable object
preference
=
portal
.
portal_preferences
.
createPreferenceForUser
(
context
.
getReference
(),
enable
=
True
,
)
except
ValueError
:
return
return
preference
=
portal
.
portal_preferences
.
createPreferenceForUser
(
context
.
getReference
(),
enable
=
True
)
preference
.
setTitle
(
translateString
(
'Preference for ${name}'
,
preference
.
setTitle
(
translateString
(
'Preference for ${name}'
,
mapping
=
dict
(
name
=
context
.
getTitle
().
decode
(
'utf-8'
))))
mapping
=
dict
(
name
=
context
.
getTitle
().
decode
(
'utf-8'
))))
...
...
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