Commit 2cd628ef authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Return translated Error Text, rather then raw text from ERP5 Site.

parent a0abff34
Pipeline #9659 failed with stage
in 0 seconds
......@@ -2,6 +2,7 @@ from zExceptions import Unauthorized
import json
portal = context.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()
if person.getUid() != context.getUid():
......@@ -9,7 +10,8 @@ if person.getUid() != context.getUid():
if context.Person_testLoginExistence(reference=reference):
context.REQUEST.RESPONSE.setStatus('406')
return json.dumps("Login already exists")
return json.dumps(
portal.Base_translateString("Login already exists"))
try:
erp5_login = context.newContent(
......@@ -20,6 +22,6 @@ try:
erp5_login.validate()
except ValueError as e:
context.REQUEST.RESPONSE.setStatus('406')
return json.dumps(str(e))
return json.dumps(str(portal.Base_translateString(e)))
return json.dumps(erp5_login.getRelativeUrl())
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