portal = context.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()

request = context.REQUEST
response = request.RESPONSE

import json

if person is None:
  response.setStatus(403)
  return {}

try:
  return json.dumps(person.generateCertificate())
  # Certificate is Created
except ValueError:
  # Certificate was already requested, please revoke existing one.
  return json.dumps(False)

0c57830ed5d4d9ef4001feeae5f15ed4977fa020
<mask token>

<mask token>
if person is None:
    response.setStatus(403)
    return {}
try:
    return json.dumps(person.generateCertificate())
except ValueError:
    return json.dumps(False)

portal = context.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()
request = context.REQUEST
response = request.RESPONSE
<mask token>
if person is None:
    response.setStatus(403)
    return {}
try:
    return json.dumps(person.generateCertificate())
except ValueError:
    return json.dumps(False)

portal = context.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()
request = context.REQUEST
response = request.RESPONSE
import json
if person is None:
    response.setStatus(403)
    return {}
try:
    return json.dumps(person.generateCertificate())
except ValueError:
    return json.dumps(False)

portal = context.getPortalObject()
person = portal.portal_membership.getAuthenticatedMember().getUserValue()

request = context.REQUEST
response = request.RESPONSE

import json

if person is None:
  response.setStatus(403)
  return {}

try:
  return json.dumps(person.generateCertificate())
  # Certificate is Created
except ValueError:
  # Certificate was already requested, please revoke existing one.
  return json.dumps(False)
