Commit bf32fac0 authored by Marcos Felipe Barboza's avatar Marcos Felipe Barboza
Browse files

Merge branch 'release/1.3.9' into 'master'

Create certificate if user dont have

See merge request !5
parents 31b2a7c0 85067ca1
......@@ -315,7 +315,7 @@ class Member(object):
# Return operation dictionary.
return operation
def create_certificate(member_urn, credential, **kwargs):
def create_certificate(self, credential, member_urn, **kwargs):
''' This is the method used to create a member's certificate in the
CH. It is possible to automatically create and store a private key
alongside the certificate, or just sign an optional CSR in the
......@@ -324,6 +324,9 @@ class Member(object):
ATTENTION: With the current CH implementation, it is not necessary to
call this method via Portal. The member certificate is created with
the activation of member account.
UPDATE: To fix bug in CH, now, this method is called to generate certifcate
if update fails
'''
# Set parameter dictionary.
......
......@@ -100,6 +100,11 @@ def renew_cert(request):
operation = Member().update_certificate(
credential=Portal.get_portal_credential(), member_urn=member_urn)
# Create certificate if user doesnt have
if operation.get('operation_status', '') != 'success':
operation = Member().create_certificate(
credential=Portal.get_portal_credential(), member_urn=member_urn)
# Check if a post request was submitted and if upload_cert
# flag is in request.
elif 'upload_cert' in request.POST:
......
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