Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fibre
portal-interface
Commits
85067ca1
Commit
85067ca1
authored
Apr 15, 2020
by
marcosfelipp
Browse files
Create certificate if user dont have
parent
b73650b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
portal/models/member.py
portal/models/member.py
+4
-1
portal/views/views_certs.py
portal/views/views_certs.py
+5
-0
No files found.
portal/models/member.py
View file @
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.
...
...
portal/views/views_certs.py
View file @
85067ca1
...
...
@@ -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
:
...
...
Marcos Felipe Barboza
@marcosabreu
mentioned in issue
#101 (closed)
·
Apr 15, 2020
mentioned in issue
#101 (closed)
mentioned in issue #101
Toggle commit list
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