Refactor dcl's ssh key name prefix to DCL_SSH_KEY_NAME_PREFIX
This commit is contained in:
parent
0706ac5909
commit
dd9b0d8fd9
3 changed files with 8 additions and 2 deletions
|
|
@ -487,7 +487,7 @@ class SSHKeyCreateView(LoginRequiredMixin, FormView):
|
|||
|
||||
def form_valid(self, form):
|
||||
form.save()
|
||||
if 'dcl-gen-key-' in form.instance.name:
|
||||
if settings.DCL_SSH_KEY_NAME_PREFIX in form.instance.name:
|
||||
content = ContentFile(form.cleaned_data.get('private_key'))
|
||||
filename = form.cleaned_data.get(
|
||||
'name') + '_' + str(uuid.uuid4())[:8] + '_private.pem'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue