Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
2cd628ef
Commit
2cd628ef
authored
May 29, 2020
by
Rafael Monnerat
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Return translated Error Text, rather then raw text from ERP5 Site.
parent
a0abff34
Pipeline
#9659
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_newLogin.py
...tem/portal_skins/slapos_hal_json_style/Person_newLogin.py
+4
-2
No files found.
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_newLogin.py
View file @
2cd628ef
...
@@ -2,6 +2,7 @@ from zExceptions import Unauthorized
...
@@ -2,6 +2,7 @@ from zExceptions import Unauthorized
import
json
import
json
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
person
.
getUid
()
!=
context
.
getUid
():
if
person
.
getUid
()
!=
context
.
getUid
():
...
@@ -9,7 +10,8 @@ if person.getUid() != context.getUid():
...
@@ -9,7 +10,8 @@ if person.getUid() != context.getUid():
if
context
.
Person_testLoginExistence
(
reference
=
reference
):
if
context
.
Person_testLoginExistence
(
reference
=
reference
):
context
.
REQUEST
.
RESPONSE
.
setStatus
(
'406'
)
context
.
REQUEST
.
RESPONSE
.
setStatus
(
'406'
)
return
json
.
dumps
(
"Login already exists"
)
return
json
.
dumps
(
portal
.
Base_translateString
(
"Login already exists"
))
try
:
try
:
erp5_login
=
context
.
newContent
(
erp5_login
=
context
.
newContent
(
...
@@ -20,6 +22,6 @@ try:
...
@@ -20,6 +22,6 @@ try:
erp5_login
.
validate
()
erp5_login
.
validate
()
except
ValueError
as
e
:
except
ValueError
as
e
:
context
.
REQUEST
.
RESPONSE
.
setStatus
(
'406'
)
context
.
REQUEST
.
RESPONSE
.
setStatus
(
'406'
)
return
json
.
dumps
(
str
(
e
))
return
json
.
dumps
(
str
(
portal
.
Base_translateString
(
e
)
))
return
json
.
dumps
(
erp5_login
.
getRelativeUrl
())
return
json
.
dumps
(
erp5_login
.
getRelativeUrl
())
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